diff --git a/scripts/test.js b/scripts/test.js index 141c68c..8ae7840 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -10,7 +10,10 @@ const getKarmaConfig = require( './utils/getkarmaconfig' ); const { Server, config } = require( 'karma' ); -const parsedConfig = config.parseConfig( null, getKarmaConfig() ); -const server = new Server( parsedConfig ); +( async () => { + const parsedConfig = config.parseConfig( null, await getKarmaConfig() ); + const server = new Server( parsedConfig ); + + server.start(); +} )(); -server.start(); diff --git a/scripts/utils/getkarmaconfig.js b/scripts/utils/getkarmaconfig.js index d03f14e..d212fc5 100644 --- a/scripts/utils/getkarmaconfig.js +++ b/scripts/utils/getkarmaconfig.js @@ -10,11 +10,11 @@ const path = require( 'path' ); const options = parseArguments( process.argv.slice( 2 ) ); -module.exports = function getKarmaConfig() { +module.exports = async function getKarmaConfig() { const basePath = process.cwd(); const coverageDir = path.join( basePath, 'coverage' ); - const webpackConfig = require( '../../webpack.config.js' )( {}, { + const webpackConfig = ( await import( '../../webpack.config.mjs' ) ).default( {}, { mode: 'development' } );