@@ -7,7 +7,7 @@ const promiseConfig = require('./webpack.promise.config.cjs');
77
88describe ( 'ConfigGroup' , function ( ) {
99 it ( 'should handle merge properly' , async ( ) => {
10- const group = new ConfigGroup ( [
10+ const result = await ConfigGroup ( [
1111 {
1212 merge : true ,
1313 } ,
@@ -16,7 +16,6 @@ describe('ConfigGroup', function () {
1616 } ,
1717 ] ) ;
1818
19- const result = await group . run ( ) ;
2019 const expectedOptions = {
2120 output : { filename : './dist-commonjs.js' , libraryTarget : 'commonjs' } ,
2221 entry : './a.js' ,
@@ -30,35 +29,31 @@ describe('ConfigGroup', function () {
3029 } ) ;
3130
3231 it ( 'should return array for multiple config' , async ( ) => {
33- const group = new ConfigGroup ( [
32+ const result = await ConfigGroup ( [
3433 { config : [ resolve ( __dirname , './webpack.config1.cjs' ) , resolve ( __dirname , './webpack.config2.cjs' ) ] } ,
3534 ] ) ;
36- const result = await group . run ( ) ;
3735 const expectedOptions = [ config1 , config2 ] ;
3836 expect ( result . options ) . toEqual ( expectedOptions ) ;
3937 expect ( result . outputOptions ) . toEqual ( { } ) ;
4038 } ) ;
4139
4240 it ( 'should return config object for single config' , async ( ) => {
43- const group = new ConfigGroup ( [ { config : [ resolve ( __dirname , './webpack.config1.cjs' ) ] } ] ) ;
44- const result = await group . run ( ) ;
41+ const result = await ConfigGroup ( [ { config : [ resolve ( __dirname , './webpack.config1.cjs' ) ] } ] ) ;
4542 expect ( result . options ) . toEqual ( config1 ) ;
4643 expect ( result . outputOptions ) . toEqual ( { } ) ;
4744 } ) ;
4845
4946 it ( 'should return resolved config object for promise config' , async ( ) => {
50- const group = new ConfigGroup ( [ { config : [ resolve ( __dirname , './webpack.promise.config.cjs' ) ] } ] ) ;
51- const result = await group . run ( ) ;
47+ const result = await ConfigGroup ( [ { config : [ resolve ( __dirname , './webpack.promise.config.cjs' ) ] } ] ) ;
5248 const expectedOptions = await promiseConfig ( ) ;
5349 expect ( result . options ) . toEqual ( expectedOptions ) ;
5450 expect ( result . outputOptions ) . toEqual ( { } ) ;
5551 } ) ;
5652
5753 it ( 'should handle configs returning different types' , async ( ) => {
58- const group = new ConfigGroup ( [
54+ const result = await ConfigGroup ( [
5955 { config : [ resolve ( __dirname , './webpack.promise.config.cjs' ) , resolve ( __dirname , './webpack.config.cjs' ) ] } ,
6056 ] ) ;
61- const result = await group . run ( ) ;
6257 const resolvedPromiseConfig = await promiseConfig ( ) ;
6358 const expectedOptions = [ resolvedPromiseConfig , ...arrayConfig ] ;
6459 expect ( result . options ) . toEqual ( expectedOptions ) ;
0 commit comments