File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,11 @@ describe('parsedTsConfig', () => {
43
43
expect ( get ( { tsconfig : { target : 'esnext' } as any } ) . options . target ) . toBe ( ts . ScriptTarget . ESNext )
44
44
} )
45
45
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 )
48
51
} )
49
52
50
53
it ( 'should override some options' , ( ) => {
Original file line number Diff line number Diff line change @@ -447,7 +447,13 @@ export class ConfigSet {
447
447
this . logger . warn ( message )
448
448
}
449
449
450
- return result
450
+ return {
451
+ ...result ,
452
+ options : {
453
+ ...result . options ,
454
+ module : result . options . module ?? this . compilerModule . ModuleKind . CommonJS ,
455
+ } ,
456
+ }
451
457
}
452
458
453
459
/**
You can’t perform that action at this time.
0 commit comments