From b67f6ec7100b2c50f120723b1d1597125baa92dc Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 14 Mar 2019 13:18:06 -0700 Subject: [PATCH] Display actual and expected diagnostic messages when they dont match --- src/harness/fakes.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/harness/fakes.ts b/src/harness/fakes.ts index 57e3722f64d..dcc125698c8 100644 --- a/src/harness/fakes.ts +++ b/src/harness/fakes.ts @@ -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 ==") {