Skip to content

Commit 95c3ecc

Browse files
Merge pull request #11049 from RyanCavanaugh/correctErrorBaseline
Correctly remove stale .error.txt baselines
2 parents 40327b3 + a0206ec commit 95c3ecc

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/harness/compilerRunner.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ class CompilerBaselineRunner extends RunnerBase {
136136

137137
// check errors
138138
it("Correct errors for " + fileName, () => {
139-
if (this.errors) {
140-
Harness.Compiler.doErrorBaseline(justName, toBeCompiled.concat(otherFiles), result.errors);
141-
}
139+
Harness.Compiler.doErrorBaseline(justName, toBeCompiled.concat(otherFiles), result.errors);
142140
});
143141

144142
it (`Correct module resolution tracing for ${fileName}`, () => {

src/harness/harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ namespace Harness {
14071407

14081408
export function doErrorBaseline(baselinePath: string, inputFiles: TestFile[], errors: ts.Diagnostic[]) {
14091409
Harness.Baseline.runBaseline(baselinePath.replace(/\.tsx?$/, ".errors.txt"), (): string => {
1410-
if (errors.length === 0) {
1410+
if (!errors || (errors.length === 0)) {
14111411
/* tslint:disable:no-null-keyword */
14121412
return null;
14131413
/* tslint:enable:no-null-keyword */

0 commit comments

Comments
 (0)