Skip to content

Commit 4dd9f69

Browse files
authored
Disable diagnostic consistency checking for large tests (microsoft#40280)
1 parent 1b404ae commit 4dd9f69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/harness/compilerImpl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ namespace compiler {
256256
if (compilerOptions.skipDefaultLibCheck === undefined) compilerOptions.skipDefaultLibCheck = true;
257257
if (compilerOptions.noErrorTruncation === undefined) compilerOptions.noErrorTruncation = true;
258258

259-
const preProgram = ts.createProgram(rootFiles || [], { ...compilerOptions, traceResolution: false }, host);
260-
const preErrors = ts.getPreEmitDiagnostics(preProgram);
259+
const preProgram = ts.length(rootFiles) < 100 ? ts.createProgram(rootFiles || [], { ...compilerOptions, traceResolution: false }, host) : undefined;
260+
const preErrors = preProgram && ts.getPreEmitDiagnostics(preProgram);
261261

262262
const program = ts.createProgram(rootFiles || [], compilerOptions, host);
263263
const emitResult = program.emit();
264264
const postErrors = ts.getPreEmitDiagnostics(program);
265-
const errors = (preErrors.length !== postErrors.length) ? [...postErrors,
265+
const errors = preErrors && (preErrors.length !== postErrors.length) ? [...postErrors,
266266
ts.addRelatedInfo(
267267
ts.createCompilerDiagnostic({
268268
category: ts.DiagnosticCategory.Error,

0 commit comments

Comments
 (0)