mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 12:57:11 -06:00
Display actual and expected diagnostic messages when they dont match
This commit is contained in:
parent
7824fbc395
commit
b67f6ec710
@ -476,7 +476,9 @@ namespace fakes {
|
||||
assertDiagnosticMessages(...expectedDiagnostics: ExpectedDiagnostic[]) {
|
||||
const actual = this.diagnostics.slice().map(d => d.messageText as string);
|
||||
const expected = expectedDiagnostics.map(expectedDiagnosticToText);
|
||||
assert.deepEqual(actual, expected, "Diagnostic arrays did not match");
|
||||
assert.deepEqual(actual, expected, `Diagnostic arrays did not match:
|
||||
Actual: ${JSON.stringify(actual, /*replacer*/ undefined, " ")}
|
||||
Expected: ${JSON.stringify(expected, /*replacer*/ undefined, " ")}`);
|
||||
}
|
||||
|
||||
printDiagnostics(header = "== Diagnostics ==") {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user