File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,8 +43,11 @@ describe('parsedTsConfig', () => {
4343 expect ( get ( { tsconfig : { target : 'esnext' } as any } ) . options . target ) . toBe ( ts . ScriptTarget . ESNext )
4444 } )
4545
46- it ( 'should fallback to ES2015 as default target when no target defined in tsconfig' , ( ) => {
47- expect ( get ( { tsconfig : 'tsconfig.spec.json' } ) . options . target ) . toBe ( ts . ScriptTarget . ES2015 )
46+ it ( 'should fallback to ES2015 as default target and CommonJS as default module when no target or module defined in tsconfig' , ( ) => {
47+ const compilerOptions = get ( { tsconfig : 'tsconfig.spec.json' } ) . options
48+
49+ expect ( compilerOptions . target ) . toBe ( ts . ScriptTarget . ES2015 )
50+ expect ( compilerOptions . module ) . toBe ( ts . ModuleKind . CommonJS )
4851 } )
4952
5053 it ( 'should override some options' , ( ) => {
Original file line number Diff line number Diff line change @@ -447,7 +447,13 @@ export class ConfigSet {
447447 this . logger . warn ( message )
448448 }
449449
450- return result
450+ return {
451+ ...result ,
452+ options : {
453+ ...result . options ,
454+ module : result . options . module ?? this . compilerModule . ModuleKind . CommonJS ,
455+ } ,
456+ }
451457 }
452458
453459 /**
You can’t perform that action at this time.
0 commit comments