File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -789,7 +789,6 @@ describe('_resolveTsConfig', () => {
789
789
expect ( conf . options . configFilePath ) . toBeUndefined ( )
790
790
expect ( findConfig ) . not . toHaveBeenCalled ( )
791
791
expect ( readConfig . mock . calls [ 0 ] [ 0 ] ) . toBe ( '/foo/tsconfig.bar.json' )
792
- expect ( parseConfig ) . not . toHaveBeenCalled ( )
793
792
} )
794
793
} )
795
794
@@ -917,7 +916,6 @@ describe('_resolveTsConfig', () => {
917
916
918
917
const conf = cs . parsedTsConfig
919
918
expect ( conf . options . path ) . toBe ( tscfgPathStub )
920
- expect ( findConfig ) . not . toHaveBeenCalled ( )
921
919
expect ( readConfig . mock . calls [ 0 ] [ 0 ] ) . toBe ( tscfgPathStub )
922
920
expect ( parseConfig . mock . calls [ 0 ] [ 2 ] ) . toBe ( '/foo' )
923
921
expect ( parseConfig . mock . calls [ 0 ] [ 4 ] ) . toBe ( tscfgPathStub )
Original file line number Diff line number Diff line change @@ -604,16 +604,21 @@ export class ConfigSet {
604
604
? normalizeSlashes ( resolvedConfigFile )
605
605
: ts . findConfigFile ( normalizeSlashes ( this . rootDir ) , ts . sys . fileExists )
606
606
607
- return this . _findReferenceTsconfig ( configFileName )
607
+ const newTsconfigFile = this . _findReferenceTsconfig ( configFileName )
608
+
609
+ return newTsconfigFile ?? configFileName
608
610
}
609
611
610
612
protected _findReferenceTsconfig ( tsconfigFileName ?: string ) : string | undefined {
611
613
const ts = this . compilerModule
612
614
613
615
if ( ! tsconfigFileName ) return
614
616
615
- const rawTsconfig = ts . readConfigFile ( tsconfigFileName , ts . sys . readFile ) . config
616
- const parsedTsconfig = this . _parseTsconfig ( rawTsconfig , dirname ( tsconfigFileName ) , tsconfigFileName )
617
+ const parsedTsconfig = this . _parseTsconfig (
618
+ ts . readConfigFile ( tsconfigFileName , ts . sys . readFile ) . config || { } ,
619
+ dirname ( tsconfigFileName ) ,
620
+ tsconfigFileName ,
621
+ )
617
622
618
623
if ( this . _includesTestFilesInConfig ( parsedTsconfig ) ) return tsconfigFileName
619
624
You can’t perform that action at this time.
0 commit comments