Skip to content

Commit 5afa0d4

Browse files
authored
Merge pull request #30409 from Microsoft/betterDiagnostics
Display actual and expected diagnostic messages when they dont match
2 parents 1c8a359 + b67f6ec commit 5afa0d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/harness/fakes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ namespace fakes {
476476
assertDiagnosticMessages(...expectedDiagnostics: ExpectedDiagnostic[]) {
477477
const actual = this.diagnostics.slice().map(d => d.messageText as string);
478478
const expected = expectedDiagnostics.map(expectedDiagnosticToText);
479-
assert.deepEqual(actual, expected, "Diagnostic arrays did not match");
479+
assert.deepEqual(actual, expected, `Diagnostic arrays did not match:
480+
Actual: ${JSON.stringify(actual, /*replacer*/ undefined, " ")}
481+
Expected: ${JSON.stringify(expected, /*replacer*/ undefined, " ")}`);
480482
}
481483

482484
printDiagnostics(header = "== Diagnostics ==") {

0 commit comments

Comments
 (0)