From dddb2196429b802463afa953184051a6d4e5f9d1 Mon Sep 17 00:00:00 2001 From: Harminder virk Date: Tue, 14 Apr 2020 16:55:38 +0530 Subject: [PATCH] test: fix test helpers to address newlines issue on windows --- test-helpers/index.ts | 2 +- test/edge.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test-helpers/index.ts b/test-helpers/index.ts index 5af2b71..22a35d1 100644 --- a/test-helpers/index.ts +++ b/test-helpers/index.ts @@ -13,7 +13,7 @@ import stringify from 'js-stringify' export function normalizeNewLines (value: string) { // eslint-disable-next-line @typescript-eslint/quotes - return value.replace(/out\s\+=\s"\\n"/g, `out += ${EOL === '\n' ? `"\\n"` : `"\\r\\n"`}`) + return value.replace(/\+=\s"\\n"/g, `+= ${EOL === '\n' ? `"\\n"` : `"\\r\\n"`}`) } export function normalizeFilename (basePath: string, value: string) { diff --git a/test/edge.spec.ts b/test/edge.spec.ts index 3cc3a69..960588b 100644 --- a/test/edge.spec.ts +++ b/test/edge.spec.ts @@ -268,7 +268,7 @@ test.group('Edge | regression', () => { `, }) - assert.equal(edge.render('eval'), dedent` + assert.stringEqual(edge.render('eval'), dedent`