@@ -18,19 +18,21 @@ describe('readConfigFile', () => {
1818 } ) ;
1919 test ( 'returns the default options even if tsconfig is empty' , async ( ) => {
2020 const iff = await createIFF ( { 'tsconfig.json' : '{}' } ) ;
21- expect ( readConfigFile ( iff . rootDir ) ) . toStrictEqual < CMKConfig > (
22- expect . objectContaining ( {
23- includes : [ iff . join ( '**/*' ) ] ,
24- excludes : [ ] ,
25- dtsOutDir : iff . join ( 'generated' ) ,
26- arbitraryExtensions : false ,
27- namedExports : false ,
28- prioritizeNamedImports : false ,
29- keyframes : true ,
30- compilerOptions : expect . any ( Object ) ,
31- wildcardDirectories : [ { fileName : iff . rootDir , recursive : true } ] ,
32- } ) ,
33- ) ;
21+ expect ( readConfigFile ( iff . rootDir ) ) . toStrictEqual < CMKConfig > ( {
22+ includes : [ iff . join ( '**/*' ) ] ,
23+ excludes : [ ] ,
24+ dtsOutDir : iff . join ( 'generated' ) ,
25+ arbitraryExtensions : false ,
26+ namedExports : false ,
27+ prioritizeNamedImports : false ,
28+ keyframes : true ,
29+ basePath : iff . rootDir ,
30+ configFileName : iff . paths [ 'tsconfig.json' ] ,
31+ compilerOptions : expect . any ( Object ) ,
32+ wildcardDirectories : [ { fileName : iff . rootDir , recursive : true } ] ,
33+ extendedSourceFiles : [ ] ,
34+ diagnostics : [ ] ,
35+ } ) ;
3436 } ) ;
3537 test ( 'default option values are overridden by config file values' , async ( ) => {
3638 const iff = await createIFF ( {
@@ -101,6 +103,7 @@ describe('readConfigFile', () => {
101103 module : ts . ModuleKind . ESNext ,
102104 } ) ,
103105 wildcardDirectories : [ { fileName : iff . join ( 'src' ) , recursive : true } ] ,
106+ extendedSourceFiles : [ iff . join ( 'tsconfig.base.json' ) ] ,
104107 } ) ,
105108 ) ;
106109 } ) ;
@@ -134,6 +137,7 @@ describe('readConfigFile', () => {
134137 module : ts . ModuleKind . ES2015 ,
135138 } ) ,
136139 wildcardDirectories : [ { fileName : iff . join ( 'src2' ) , recursive : true } ] ,
140+ extendedSourceFiles : [ iff . join ( 'tsconfig.base.json' ) ] ,
137141 } ) ,
138142 ) ;
139143 } ) ;
@@ -161,6 +165,7 @@ describe('readConfigFile', () => {
161165 module : ts . ModuleKind . ESNext ,
162166 } ) ,
163167 wildcardDirectories : [ { fileName : iff . join ( 'src' ) , recursive : true } ] ,
168+ extendedSourceFiles : [ iff . join ( 'tsconfig.base2.json' ) , iff . join ( 'tsconfig.base1.json' ) ] ,
164169 } ) ,
165170 ) ;
166171 } ) ;
@@ -185,21 +190,6 @@ describe('readConfigFile', () => {
185190 } ) ;
186191 expect ( readConfigFile ( iff . rootDir ) . dtsOutDir ) . toBe ( iff . join ( 'generated2' ) ) ;
187192 } ) ;
188- test ( 'inherits from a package' , async ( ) => {
189- const iff = await createIFF ( {
190- 'node_modules/some-pkg/tsconfig.json' : dedent `
191- {
192- "cmkOptions": { "dtsOutDir": "generated/cmk" }
193- }
194- ` ,
195- 'tsconfig.json' : dedent `
196- {
197- "extends": "some-pkg/tsconfig.json"
198- }
199- ` ,
200- } ) ;
201- expect ( readConfigFile ( iff . rootDir ) . dtsOutDir ) . toBe ( iff . join ( 'generated/cmk' ) ) ;
202- } ) ;
203193 test ( 'inherits from multiple files' , async ( ) => {
204194 const iff = await createIFF ( {
205195 'tsconfig.base1.json' : dedent `
@@ -222,6 +212,7 @@ describe('readConfigFile', () => {
222212 expect . objectContaining ( {
223213 dtsOutDir : iff . join ( 'generated/cmk' ) ,
224214 arbitraryExtensions : true ,
215+ extendedSourceFiles : [ iff . join ( 'tsconfig.base1.json' ) , iff . join ( 'tsconfig.base2.json' ) ] ,
225216 } ) ,
226217 ) ;
227218 } ) ;
0 commit comments