@@ -52,6 +52,19 @@ describe("extends property", () => {
5252 expect ( stdout ) . toContain ( "topLevelAwait: true" ) ;
5353 } ) ;
5454
55+ it ( "extends a provided webpack config for multiple configs correctly #2" , async ( ) => {
56+ const { exitCode, stderr, stdout } = await run ( __dirname + "/multiple-configs2" ) ;
57+
58+ expect ( exitCode ) . toBe ( 0 ) ;
59+ expect ( stderr ) . toBeFalsy ( ) ;
60+ expect ( stdout ) . toContain ( "base.webpack.config.js" ) ;
61+ expect ( stdout ) . toContain ( "derived.webpack.config.js" ) ;
62+ expect ( stdout ) . toContain ( "name: 'base_config'" ) ;
63+ expect ( stdout ) . toContain ( "name: 'derived_config2'" ) ;
64+ expect ( stdout ) . toContain ( "mode: 'development'" ) ;
65+ expect ( stdout ) . toContain ( "topLevelAwait: true" ) ;
66+ } ) ;
67+
5568 it ( "multiple extends a provided webpack config passed in the cli correctly" , async ( ) => {
5669 const { exitCode, stderr, stdout } = await run ( __dirname + "/extends-cli-option" , [
5770 "--extends" ,
@@ -70,6 +83,24 @@ describe("extends property", () => {
7083 expect ( stdout ) . toContain ( "bail: true" ) ;
7184 } ) ;
7285
86+ it ( "should work with multiple extends and multiple configuration" , async ( ) => {
87+ const { exitCode, stderr, stdout } = await run ( __dirname + "/multiple-configs1" , [
88+ "--extends" ,
89+ "./base.webpack.config.js" ,
90+ "--extends" ,
91+ "./other.config.js" ,
92+ ] ) ;
93+
94+ expect ( exitCode ) . toBe ( 0 ) ;
95+ expect ( stderr ) . toBeFalsy ( ) ;
96+ expect ( stdout ) . toContain ( "derived.webpack.config.js" ) ;
97+ expect ( stdout ) . toContain ( "base.webpack.config.js" ) ;
98+ expect ( stdout ) . toContain ( "other.config.js" ) ;
99+ expect ( stdout ) . toContain ( "name: 'derived_config1'" ) ;
100+ expect ( stdout ) . toContain ( "name: 'derived_config2'" ) ;
101+ expect ( stdout ) . toContain ( "topLevelAwait: true" ) ;
102+ } ) ;
103+
73104 it ( "CLI `extends` should override `extends` in a configuration" , async ( ) => {
74105 const { exitCode, stderr, stdout } = await run ( __dirname + "/simple-case" , [
75106 "--extends" ,
0 commit comments