@@ -8,12 +8,8 @@ const configDirPath = path.join(
88 '..' ,
99 '..' ,
1010 '..' ,
11- '..' ,
12- 'testing' ,
13- 'test-fixtures' ,
14- 'src' ,
15- 'lib' ,
16- 'fixtures' ,
11+ 'cli' ,
12+ 'mocks' ,
1713 'configs' ,
1814) ;
1915
@@ -24,22 +20,13 @@ describe('coreConfigMiddleware', () => {
2420 skipPlugins : [ ] ,
2521 } ;
2622
27- it . each ( [ 'ts' , 'mjs' , 'js' ] ) (
28- 'should load a valid .%s config' ,
29- async extension => {
30- const config = await coreConfigMiddleware ( {
31- config : path . join ( configDirPath , `code-pushup.config.${ extension } ` ) ,
32- ...CLI_DEFAULTS ,
33- } ) ;
34- expect ( config . config ) . toContain ( `code-pushup.config.${ extension } ` ) ;
35- expect ( config . upload ?. project ) . toContain ( extension ) ;
36- } ,
37- ) ;
38-
39- it ( 'should throw with invalid config path' , async ( ) => {
40- await expect (
41- coreConfigMiddleware ( { config : 'wrong/path/to/config' , ...CLI_DEFAULTS } ) ,
42- ) . rejects . toThrow ( / F i l e ' .* ' d o e s n o t e x i s t / ) ;
23+ it ( 'should load a valid .ts 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' ) ;
4330 } ) ;
4431
4532 it ( 'should load config which relies on provided --tsconfig' , async ( ) => {
@@ -54,16 +41,4 @@ describe('coreConfigMiddleware', () => {
5441 } ) ,
5542 ) . resolves . toBeTruthy ( ) ;
5643 } ) ;
57-
58- it ( 'should throw if --tsconfig is missing but needed to resolve import' , async ( ) => {
59- await expect (
60- coreConfigMiddleware ( {
61- config : path . join (
62- configDirPath ,
63- 'code-pushup.needs-tsconfig.config.ts' ,
64- ) ,
65- ...CLI_DEFAULTS ,
66- } ) ,
67- ) . rejects . toThrow ( "Cannot find package '@example/custom-plugin'" ) ;
68- } ) ;
6944} ) ;
0 commit comments