@@ -19,11 +19,18 @@ const configDirPath = join(
1919) ;
2020
2121describe ( 'coreConfigMiddleware' , ( ) => {
22+ const CLI_DEFAULTS = {
23+ progress : true ,
24+ verbose : false ,
25+ onlyPlugins : [ ] ,
26+ } ;
27+
2228 it . each ( [ 'ts' , 'mjs' , 'js' ] ) (
2329 'should load a valid .%s config' ,
2430 async extension => {
2531 const config = await coreConfigMiddleware ( {
2632 config : join ( configDirPath , `code-pushup.config.${ extension } ` ) ,
33+ ...CLI_DEFAULTS ,
2734 } ) ;
2835 expect ( config . config ) . toContain ( `code-pushup.config.${ extension } ` ) ;
2936 expect ( config . upload ?. project ) . toContain ( extension ) ;
@@ -32,7 +39,7 @@ describe('coreConfigMiddleware', () => {
3239
3340 it ( 'should throw with invalid config path' , async ( ) => {
3441 await expect (
35- coreConfigMiddleware ( { config : 'wrong/path/to/config' } ) ,
42+ coreConfigMiddleware ( { config : 'wrong/path/to/config' , ... CLI_DEFAULTS } ) ,
3643 ) . rejects . toThrow ( / P r o v i d e d p a t h .* i s n o t v a l i d ./ ) ;
3744 } ) ;
3845
@@ -41,6 +48,7 @@ describe('coreConfigMiddleware', () => {
4148 coreConfigMiddleware ( {
4249 config : join ( configDirPath , 'code-pushup.needs-tsconfig.config.ts' ) ,
4350 tsconfig : 'tsconfig.base.json' ,
51+ ...CLI_DEFAULTS ,
4452 } ) ,
4553 ) . resolves . toBeTruthy ( ) ;
4654 } ) ;
@@ -49,6 +57,7 @@ describe('coreConfigMiddleware', () => {
4957 await expect (
5058 coreConfigMiddleware ( {
5159 config : join ( configDirPath , 'code-pushup.needs-tsconfig.config.ts' ) ,
60+ ...CLI_DEFAULTS ,
5261 } ) ,
5362 ) . rejects . toThrow ( "Cannot find package '@code-pushup/models'" ) ;
5463 } ) ;
0 commit comments