Skip to content

Commit 945eb11

Browse files
author
Yui T
committed
Revert change to the harness that break the unittest
1 parent d4a4522 commit 945eb11

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/harness/harness.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,16 @@ module Harness {
14151415
assert.equal(markedErrorCount, fileErrors.length, "count of errors in " + inputFile.unitName);
14161416
});
14171417

1418-
assert.equal(totalErrorsReported, diagnostics.length, "total number of errors");
1418+
let numLibraryDiagnostics = ts.countWhere(diagnostics, diagnostic => {
1419+
return diagnostic.file && (isLibraryFile(diagnostic.file.fileName) || isBuiltFile(diagnostic.file.fileName));
1420+
});
1421+
1422+
let numTest262HarnessDiagnostics = ts.countWhere(diagnostics, diagnostic => {
1423+
// Count an error generated from tests262-harness folder.This should only apply for test262
1424+
return diagnostic.file && diagnostic.file.fileName.indexOf("test262-harness") >= 0;
1425+
});
1426+
1427+
assert.equal(totalErrorsReported + numLibraryDiagnostics + numTest262HarnessDiagnostics, diagnostics.length, "total number of errors");
14191428
return minimalDiagnosticsToString(diagnostics) +
14201429
Harness.IO.newLine() + Harness.IO.newLine() + outputLines.join("\r\n");
14211430
}

0 commit comments

Comments
 (0)