Skip to content

Commit b67f6ec

Browse files
committed
Display actual and expected diagnostic messages when they dont match
1 parent 7824fbc commit b67f6ec

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)