@@ -158,88 +158,12 @@ describe('AngularCompilation', () => {
158158 suppressOutputPathCheck : true ,
159159 outDir : undefined ,
160160 } ) ,
161- undefined ,
162- jasmine . any ( Map ) ,
163161 ) ;
164162 expect ( result . rootNames ) . toEqual ( [ '/src/main.ts' ] ) ;
165163 expect ( result . compilerOptions . target ) . toBe ( ts . ScriptTarget . ES2022 ) ;
166164 expect ( result . compilerOptions . inlineSources ) . toBe ( true ) ;
167165 expect ( result . warnings . length ) . toBeGreaterThan ( 0 ) ;
168166 } ) ;
169-
170- it ( 'passes extendedConfigCache to readConfiguration and returns its keys in extendedConfigFiles' , async ( ) => {
171- const compilation = new MockTypeScriptCompilation ( ) ;
172- const mockReadConfig = jasmine
173- . createSpy ( 'readConfiguration' )
174- . and . callFake (
175- (
176- _project : string ,
177- _options ?: unknown ,
178- _host ?: unknown ,
179- extendedConfigCache ?: Map < string , ts . ExtendedConfigCacheEntry > ,
180- ) => {
181- extendedConfigCache ?. set (
182- '/workspace/tsconfig.base.json' ,
183- { } as ts . ExtendedConfigCacheEntry ,
184- ) ;
185-
186- return {
187- options : { target : ts . ScriptTarget . ES2022 } ,
188- rootNames : [ '/src/main.ts' ] ,
189- errors : [ ] ,
190- } ;
191- } ,
192- ) ;
193- spyOn ( TypeScriptCompilation , 'loadCompilerCli' ) . and . resolveTo ( {
194- readConfiguration : mockReadConfig ,
195- } as unknown as typeof import ( '@angular/compiler-cli' ) ) ;
196-
197- const result = await compilation . testLoadConfiguration ( 'tsconfig.json' ) ;
198-
199- expect ( mockReadConfig ) . toHaveBeenCalledWith (
200- 'tsconfig.json' ,
201- jasmine . anything ( ) ,
202- undefined ,
203- jasmine . any ( Map ) ,
204- ) ;
205- expect ( result . extendedConfigFiles ) . toEqual ( [ '/workspace/tsconfig.base.json' ] ) ;
206- } ) ;
207-
208- it ( 'clears extendedConfigCache when a tsconfig file is invalidated' , async ( ) => {
209- const compilation = new MockTypeScriptCompilation ( ) ;
210- let capturedCache : Map < string , ts . ExtendedConfigCacheEntry > | undefined ;
211- const mockReadConfig = jasmine
212- . createSpy ( 'readConfiguration' )
213- . and . callFake (
214- (
215- _project : string ,
216- _options ?: unknown ,
217- _host ?: unknown ,
218- extendedConfigCache ?: Map < string , ts . ExtendedConfigCacheEntry > ,
219- ) => {
220- capturedCache = extendedConfigCache ;
221- extendedConfigCache ?. set (
222- '/workspace/tsconfig.base.json' ,
223- { } as ts . ExtendedConfigCacheEntry ,
224- ) ;
225-
226- return {
227- options : { target : ts . ScriptTarget . ES2022 } ,
228- rootNames : [ '/src/main.ts' ] ,
229- errors : [ ] ,
230- } ;
231- } ,
232- ) ;
233- spyOn ( TypeScriptCompilation , 'loadCompilerCli' ) . and . resolveTo ( {
234- readConfiguration : mockReadConfig ,
235- } as unknown as typeof import ( '@angular/compiler-cli' ) ) ;
236-
237- await compilation . testLoadConfiguration ( 'tsconfig.json' ) ;
238- expect ( capturedCache ?. has ( '/workspace/tsconfig.base.json' ) ) . toBeTrue ( ) ;
239-
240- await compilation . update ( new Set ( [ '/workspace/tsconfig.base.json' ] ) ) ;
241- expect ( capturedCache ?. has ( '/workspace/tsconfig.base.json' ) ) . toBeFalse ( ) ;
242- } ) ;
243167 } ) ;
244168
245169 describe ( 'createAngularCompilation' , ( ) => {
0 commit comments