Skip to content

Commit

Permalink
Aligned scripts to webpack.config.mjs.
Browse files Browse the repository at this point in the history
  • Loading branch information
psmyrek committed Sep 23, 2024
1 parent 203b573 commit 9137f80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
4 changes: 2 additions & 2 deletions scripts/utils/getkarmaconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
} );

Expand Down

0 comments on commit 9137f80

Please sign in to comment.