File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -394,4 +394,35 @@ describe("loadConfig", () => {
394394 } ,
395395 } ) ;
396396 } ) ;
397+
398+ it ( "should load a config with array extends without .json extension" , ( ) => {
399+ const baseConfig = {
400+ compilerOptions : { baseUrl : "." , paths : { foo : [ "bar" ] } } ,
401+ } ;
402+ const baseConfigPath = join ( "/root" , "base-config-1.json" ) ;
403+ const actualConfig = { extends : [ "./base-config-1" ] } ;
404+ const actualConfigPath = join ( "/root" , "tsconfig.json" ) ;
405+
406+ const res = loadTsconfig (
407+ join ( "/root" , "tsconfig.json" ) ,
408+ ( path ) => [ baseConfigPath , actualConfigPath ] . indexOf ( path ) >= 0 ,
409+ ( path ) => {
410+ if ( path === baseConfigPath ) {
411+ return JSON . stringify ( baseConfig ) ;
412+ }
413+ if ( path === actualConfigPath ) {
414+ return JSON . stringify ( actualConfig ) ;
415+ }
416+ return "" ;
417+ }
418+ ) ;
419+
420+ expect ( res ) . toEqual ( {
421+ extends : [ "./base-config-1" ] ,
422+ compilerOptions : {
423+ baseUrl : "." ,
424+ paths : { foo : [ "bar" ] } ,
425+ } ,
426+ } ) ;
427+ } ) ;
397428} ) ;
You can’t perform that action at this time.
0 commit comments