Skip to content

Commit 0b202b2

Browse files
committed
Fix tests after rebase
1 parent e41cbb6 commit 0b202b2

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed

src/compiler/watch.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ namespace ts {
374374

375375
export function readBuilderProgram(compilerOptions: CompilerOptions, readFile: (path: string) => string | undefined) {
376376
if (compilerOptions.out || compilerOptions.outFile) return undefined;
377-
if (!isIncrementalCompilation(compilerOptions)) return undefined;
378377
const buildInfoPath = getOutputPathForBuildInfo(compilerOptions);
379378
if (!buildInfoPath) return undefined;
380379
const content = readFile(buildInfoPath);
@@ -658,7 +657,7 @@ namespace ts {
658657
((typeDirectiveNames, containingFile, redirectedReference) => resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference));
659658
const userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
660659

661-
readBuilderProgram(compilerOptions, path => compilerHost.readFile(path));
660+
builderProgram = readBuilderProgram(compilerOptions, path => compilerHost.readFile(path)) as any as T;
662661
synchronizeProgram();
663662

664663
// Update the wild card directory watch

src/testRunner/unittests/tsbuild/outFile.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,7 @@ namespace ts {
9999
// outputs
100100
...outputFiles[project.first],
101101
...outputFiles[project.second],
102-
103-
// build info
104-
outputFiles[project.third][ext.buildinfo],
105-
],
106-
// These are first not present and later read new contents to generate third output
107-
outputFiles[project.first][ext.buildinfo],
108-
outputFiles[project.second][ext.buildinfo]
102+
]
109103
);
110104

111105
let dtsChangedExpectedDiagnostics: ReadonlyArray<fakes.ExpectedDiagnostic> = [
@@ -131,12 +125,8 @@ namespace ts {
131125
...outputFiles[project.first],
132126
...outputFiles[project.second],
133127
outputFiles[project.third][ext.dts],
134-
135-
// build info
136-
outputFiles[project.third][ext.buildinfo],
137128
],
138129
outputFiles[project.first][ext.dts], // dts changes so once read old content, and once new (to emit third)
139-
outputFiles[project.first][ext.buildinfo], // since first build info changes
140130
);
141131

142132
let dtsChangedExpectedDiagnosticsDependOrdered: ReadonlyArray<fakes.ExpectedDiagnostic> = [
@@ -173,8 +163,7 @@ namespace ts {
173163
...outputFiles[project.first],
174164
...outputFiles[project.second],
175165
...outputFiles[project.third],
176-
],
177-
outputFiles[project.first][ext.buildinfo], // since first build info changes
166+
]
178167
);
179168

180169
let dtsUnchangedExpectedDiagnosticsDependOrdered: ReadonlyArray<fakes.ExpectedDiagnostic> = [
@@ -227,7 +216,6 @@ namespace ts {
227216
value.set(path, 1);
228217
}
229218
value.set(outputFiles[project.second][ext.dts], 2); // dts changes so once read old content, and once new (to emit third)
230-
value.set(outputFiles[project.second][ext.buildinfo], 2); // since first build info changes
231219
return value;
232220
}
233221

src/testRunner/unittests/tscWatch/incremental.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace ts.tscWatch {
4242
}
4343

4444
function checkFileEmit(actual: Map<string>, expected: ReadonlyArray<File>) {
45-
assert.equal(actual.size, expected.length, `Actual: ${JSON.stringify(arrayFrom(actual.entries()))}\nExpected: ${JSON.stringify(expected)}`);
45+
assert.equal(actual.size, expected.length, `Actual: ${JSON.stringify(arrayFrom(actual.entries()), /*replacer*/ undefined, " ")}\nExpected: ${JSON.stringify(expected, /*replacer*/ undefined, " ")}`);
4646
expected.forEach(file => assert.equal(actual.get(file.path), file.content, `Emit for ${file.path}`));
4747
}
4848

@@ -93,7 +93,8 @@ namespace ts.tscWatch {
9393
referencedMap: {},
9494
exportedModulesMap: {},
9595
semanticDiagnosticsPerFile: [libFile.path, file1.path, file2.path]
96-
}
96+
},
97+
version
9798
})
9899
}
99100
],
@@ -115,7 +116,8 @@ namespace ts.tscWatch {
115116
referencedMap: {},
116117
exportedModulesMap: {},
117118
semanticDiagnosticsPerFile: [libFile.path, file1.path, file2.path]
118-
}
119+
},
120+
version
119121
})
120122
}
121123
],
@@ -170,7 +172,8 @@ namespace ts.tscWatch {
170172
file1.path,
171173
file2ReuasableError
172174
]
173-
}
175+
},
176+
version
174177
})
175178
}
176179
],
@@ -196,7 +199,8 @@ namespace ts.tscWatch {
196199
file1.path,
197200
file2ReuasableError
198201
]
199-
}
202+
},
203+
version
200204
})
201205
}
202206
],
@@ -228,7 +232,8 @@ namespace ts.tscWatch {
228232
{ pos: 0, end: outFile.content.length, kind: BundleFileSectionKind.Text }
229233
]
230234
},
231-
}
235+
},
236+
version
232237
})
233238
}
234239
],
@@ -294,7 +299,8 @@ namespace ts.tscWatch {
294299
referencedMap: {},
295300
exportedModulesMap: {},
296301
semanticDiagnosticsPerFile: [libFile.path, file1.path, file2.path]
297-
}
302+
},
303+
version
298304
})
299305
}
300306
],
@@ -315,7 +321,8 @@ namespace ts.tscWatch {
315321
referencedMap: {},
316322
exportedModulesMap: {},
317323
semanticDiagnosticsPerFile: [libFile.path, file1.path, file2.path]
318-
}
324+
},
325+
version
319326
})
320327
}
321328
],
@@ -370,7 +377,8 @@ namespace ts.tscWatch {
370377
file1.path,
371378
file2ReuasableError
372379
]
373-
}
380+
},
381+
version
374382
})
375383
}
376384
],
@@ -395,7 +403,8 @@ namespace ts.tscWatch {
395403
file2ReuasableError,
396404
file1.path
397405
]
398-
}
406+
},
407+
version
399408
})
400409
}
401410
],
@@ -435,7 +444,8 @@ namespace ts.tscWatch {
435444
{ pos: 0, end: outFile.content.length, kind: BundleFileSectionKind.Text }
436445
]
437446
},
438-
}
447+
},
448+
version
439449
})
440450
}
441451
],

0 commit comments

Comments
 (0)