@@ -20,22 +20,13 @@ describe('coreConfigMiddleware', () => {
2020 skipPlugins : [ ] ,
2121 } ;
2222
23- it . each ( [ 'ts' , 'mjs' , 'js' ] ) (
24- 'should load a valid .%s config' ,
25- async extension => {
26- const config = await coreConfigMiddleware ( {
27- config : path . join ( configDirPath , `code-pushup.config.${ extension } ` ) ,
28- ...CLI_DEFAULTS ,
29- } ) ;
30- expect ( config . config ) . toContain ( `code-pushup.config.${ extension } ` ) ;
31- expect ( config . upload ?. project ) . toContain ( extension ) ;
32- } ,
33- ) ;
34-
35- it ( 'should throw with invalid config path' , async ( ) => {
36- await expect (
37- coreConfigMiddleware ( { config : 'wrong/path/to/config' , ...CLI_DEFAULTS } ) ,
38- ) . rejects . toThrow ( / F i l e ' .* ' d o e s n o t e x i s t / ) ;
23+ it ( 'should load a valid .%s config' , async ( ) => {
24+ const config = await coreConfigMiddleware ( {
25+ config : path . join ( configDirPath , `code-pushup.config.ts` ) ,
26+ ...CLI_DEFAULTS ,
27+ } ) ;
28+ expect ( config . config ) . toContain ( `code-pushup.config.ts` ) ;
29+ expect ( config . upload ?. project ) . toContain ( 'ts' ) ;
3930 } ) ;
4031
4132 it ( 'should load config which relies on provided --tsconfig' , async ( ) => {
@@ -50,16 +41,4 @@ describe('coreConfigMiddleware', () => {
5041 } ) ,
5142 ) . resolves . toBeTruthy ( ) ;
5243 } ) ;
53-
54- it ( 'should throw if --tsconfig is missing but needed to resolve import' , async ( ) => {
55- await expect (
56- coreConfigMiddleware ( {
57- config : path . join (
58- configDirPath ,
59- 'code-pushup.needs-tsconfig.config.ts' ,
60- ) ,
61- ...CLI_DEFAULTS ,
62- } ) ,
63- ) . rejects . toThrow ( "Cannot find package '@example/custom-plugin'" ) ;
64- } ) ;
6544} ) ;
0 commit comments