@@ -340,7 +340,7 @@ describe('compileLibrary pipeline', () => {
340340 expect ( state . getAffectedFiles ( [ partialNew ] ) ) . toEqual ( new Set ( [ partialNew , compScss ] ) ) ;
341341 } ) ;
342342
343- it ( 'should not mark .d.ts as changed in changedDtsFiles when only .d.ts.map changed ' , async ( ) => {
343+ it ( 'should mark .d.ts as changed in changedDtsFiles when .d.ts.map changes ' , async ( ) => {
344344 const dtsPath = '/workspace/projects/my-lib/src/lib/lib.component.d.ts' ;
345345 const dtsMapPath = '/workspace/projects/my-lib/src/lib/lib.component.d.ts.map' ;
346346 const jsPath = '/workspace/projects/my-lib/src/lib/lib.component.js' ;
@@ -379,22 +379,17 @@ describe('compileLibrary pipeline', () => {
379379 await output1 . diagnosePromise ;
380380
381381 expect ( output1 . changedEsmFiles ) . toEqual ( new Set ( [ jsPath ] ) ) ;
382- expect ( output1 . changedDtsFiles . size ) . toBe ( 0 ) ;
383- // The updated .d.ts.map content should still be stored in dtsFiles
382+ expect ( output1 . changedDtsFiles ) . toEqual ( new Set ( [ dtsPath ] ) ) ;
384383 expect ( output1 . dtsFiles . get ( dtsMapPath ) ) . toBe ( '{"version":3,"mappings":"AACA"}' ) ;
385384
386- // Case 2: .d.ts content itself changes
385+ // Case 2: neither .d.ts nor .d.ts.map changed
387386 emitted = [
388- { filename : dtsPath , contents : 'export declare class LibComponent { id: string; }\n' } ,
389- { filename : dtsMapPath , contents : '{"version":3,"mappings":"AADA "}' } ,
387+ { filename : dtsPath , contents : 'export declare class LibComponent {}\n' } ,
388+ { filename : dtsMapPath , contents : '{"version":3,"mappings":"AACA "}' } ,
390389 ] ;
391390 const output2 = await compileLibrary ( createOptions ( ) , bundler , state ) ;
392391 await output2 . diagnosePromise ;
393392
394- expect ( output2 . changedDtsFiles ) . toEqual ( new Set ( [ dtsPath ] ) ) ;
395- expect ( output2 . dtsFiles . get ( dtsPath ) ) . toBe (
396- 'export declare class LibComponent { id: string; }\n' ,
397- ) ;
398- expect ( output2 . dtsFiles . get ( dtsMapPath ) ) . toBe ( '{"version":3,"mappings":"AADA"}' ) ;
393+ expect ( output2 . changedDtsFiles . size ) . toBe ( 0 ) ;
399394 } ) ;
400395} ) ;
0 commit comments