@@ -495,36 +495,35 @@ export const b = new A();`);
495495 Harness . Baseline . runBaseline ( "outfile-concat.js" , patch ? vfs . formatPatch ( patch ) : null ) ;
496496 } ) ;
497497 it ( "verify readFile calls" , ( ) => {
498- const expectedMap = createMap < number > ( ) ;
499- // Configs
500- expectedMap . set ( "/src/third/tsconfig.json" , 1 ) ;
501- expectedMap . set ( "/src/second/tsconfig.json" , 1 ) ;
502- expectedMap . set ( "/src/first/tsconfig.json" , 1 ) ;
503-
504- // Source files
505- expectedMap . set ( "/src/third/third_part1.ts" , 1 ) ;
506- expectedMap . set ( "/src/second/second_part1.ts" , 1 ) ;
507- expectedMap . set ( "/src/second/second_part2.ts" , 1 ) ;
508- expectedMap . set ( "/src/first/first_PART1.ts" , 1 ) ;
509- expectedMap . set ( "/src/first/first_part2.ts" , 1 ) ;
510- expectedMap . set ( "/src/first/first_part3.ts" , 1 ) ;
511-
512- // outputs
513- expectedMap . set ( "/src/first/bin/first-output.js" , 1 ) ;
514- expectedMap . set ( "/src/first/bin/first-output.js.map" , 1 ) ;
515- // 1 for reading source File, 1 for emit
516- expectedMap . set ( "/src/first/bin/first-output.d.ts" , 2 ) ;
517- expectedMap . set ( "/src/first/bin/first-output.d.ts.map" , 1 ) ;
518- expectedMap . set ( "/src/2/second-output.js" , 1 ) ;
519- expectedMap . set ( "/src/2/second-output.js.map" , 1 ) ;
520- // 1 for reading source File, 1 for emit
521- expectedMap . set ( "/src/2/second-output.d.ts" , 2 ) ;
522- expectedMap . set ( "/src/2/second-output.d.ts.map" , 1 ) ;
523-
524- assert . equal ( actualReadFileMap . size , expectedMap . size , `Expected: ${ JSON . stringify ( arrayFrom ( expectedMap . entries ( ) ) ) } \nActual: ${ JSON . stringify ( arrayFrom ( actualReadFileMap . entries ( ) ) ) } ` ) ;
525- actualReadFileMap . forEach ( ( value , key ) => {
526- const expected = expectedMap . get ( key ) ;
527- assert . equal ( value , expected , `Expected: ${ JSON . stringify ( arrayFrom ( expectedMap . entries ( ) ) ) } \nActual: ${ JSON . stringify ( arrayFrom ( actualReadFileMap . entries ( ) ) ) } ` ) ;
498+ const expected = [
499+ // Configs
500+ "/src/third/tsconfig.json" ,
501+ "/src/second/tsconfig.json" ,
502+ "/src/first/tsconfig.json" ,
503+
504+ // Source files
505+ "/src/third/third_part1.ts" ,
506+ "/src/second/second_part1.ts" ,
507+ "/src/second/second_part2.ts" ,
508+ "/src/first/first_PART1.ts" ,
509+ "/src/first/first_part2.ts" ,
510+ "/src/first/first_part3.ts" ,
511+
512+ // outputs
513+ "/src/first/bin/first-output.js" ,
514+ "/src/first/bin/first-output.js.map" ,
515+ "/src/first/bin/first-output.d.ts" ,
516+ "/src/first/bin/first-output.d.ts.map" ,
517+ "/src/2/second-output.js" ,
518+ "/src/2/second-output.js.map" ,
519+ "/src/2/second-output.d.ts" ,
520+ "/src/2/second-output.d.ts.map"
521+ ] ;
522+
523+ assert . equal ( actualReadFileMap . size , expected . length , `Expected: ${ JSON . stringify ( expected ) } \nActual: ${ JSON . stringify ( arrayFrom ( actualReadFileMap . entries ( ) ) ) } ` ) ;
524+ expected . forEach ( expectedValue => {
525+ const actual = actualReadFileMap . get ( expectedValue ) ;
526+ assert . equal ( actual , 1 , `Mismatch in read file call number for: ${ expectedValue } \nExpected: ${ JSON . stringify ( expected ) } \nActual: ${ JSON . stringify ( arrayFrom ( actualReadFileMap . entries ( ) ) ) } ` ) ;
528527 } ) ;
529528 } ) ;
530529 } ) ;
0 commit comments