File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,28 @@ describe('frontend-webpack-project example', () => {
284
284
} ) ;
285
285
} ) ;
286
286
} ) ;
287
+
288
+ it ( 'builds the project with doNotLoadConfig' , async ( ) => {
289
+ process . env . APP_CONFIG = 'null' ;
290
+ process . env . APP_CONFIG_ENV = 'test' ;
291
+
292
+ await new Promise < void > ( ( done , reject ) => {
293
+ webpack ( [ createOptions ( { doNotLoadConfig : true } ) ] , ( err , stats ) => {
294
+ if ( err ) return reject ( err ) ;
295
+ if ( ! stats ) return reject ( new Error ( 'no stats' ) ) ;
296
+ if ( stats . hasErrors ( ) ) reject ( stats . toString ( ) ) ;
297
+
298
+ const { children } = stats . toJson ( { source : true } ) ;
299
+ const [ { modules = [ ] } ] = children || [ ] ;
300
+
301
+ expect (
302
+ modules . some ( ( { source } ) => source ?. includes ( 'Config is not loaded in _appConfig' ) ) ,
303
+ ) . toBe ( true ) ;
304
+
305
+ done ( ) ;
306
+ } ) ;
307
+ } ) ;
308
+ } ) ;
287
309
} ) ;
288
310
289
311
describe ( 'regex' , ( ) => {
You can’t perform that action at this time.
0 commit comments