From 45f3680efcc00c4a1b5e02386a2a5747e067c271 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Mon, 6 Jul 2020 22:36:59 -0400 Subject: [PATCH] Make ALL Whitespace Visible on Error --- src/test/extension.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/extension.test.ts b/src/test/extension.test.ts index 68039e9..640ec47 100644 --- a/src/test/extension.test.ts +++ b/src/test/extension.test.ts @@ -130,7 +130,7 @@ function testFormatter(xmlFormatter: XmlFormatter, options: XmlFormattingOptions const actualFormattedXml = xmlFormatter.formatXml(unformattedXml, options).replace(/\r/g, ""); // tslint:disable-next-line - assert.ok((actualFormattedXml === expectedFormattedXml), `Actual formatted XML does not match expected formatted XML.\n\nACTUAL\n${actualFormattedXml}\n\nEXPECTED\n${expectedFormattedXml}`); + assert.ok((actualFormattedXml === expectedFormattedXml), `Actual formatted XML does not match expected formatted XML.\n\nACTUAL\n${actualFormattedXml.replace(/\s/, "~ws~")}\n\nEXPECTED\n${expectedFormattedXml.replace(/\s/, "~ws~")}`); } function testMinifier(xmlFormatter: XmlFormatter, options: XmlFormattingOptions, fileLabel: string): void { @@ -140,5 +140,5 @@ function testMinifier(xmlFormatter: XmlFormatter, options: XmlFormattingOptions, const actualMinifiedXml = xmlFormatter.minifyXml(unminifiedXml, options).replace(/\r/g, ""); // tslint:disable-next-line - assert.ok((actualMinifiedXml === expectedMinifiedXml), `Actual minified XML does not match expected minified XML.\n\nACTUAL\n${actualMinifiedXml}\n\nEXPECTED\n${expectedMinifiedXml}`); + assert.ok((actualMinifiedXml === expectedMinifiedXml), `Actual minified XML does not match expected minified XML.\n\nACTUAL\n${actualMinifiedXml.replace(/\s/, "~ws~")}\n\nEXPECTED\n${expectedMinifiedXml.replace(/\s/, "~ws~")}`); }