From 3e404e1afb100f39f6da57759be9d19085819d83 Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Thu, 27 Mar 2025 16:36:34 +0100 Subject: [PATCH] Fix tests on Windows. --- lib/step-definitions.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/step-definitions.test.ts b/lib/step-definitions.test.ts index 2480e89b..481a9ffb 100644 --- a/lib/step-definitions.test.ts +++ b/lib/step-definitions.test.ts @@ -58,7 +58,7 @@ function example( } for (let i = 0; i < expected.length; i++) { - if (expected[i] !== actual[i]) { + if (expected[i] !== actual[i].replace(/\\/g, '/')) { throwUnequal(); } } @@ -72,7 +72,10 @@ describe("pathParts()", () => { it(`should return ${util.inspect(expectedParts)} for ${util.inspect( relativePath, )}`, () => { - assert.deepStrictEqual(pathParts(relativePath), expectedParts); + let actualParts = pathParts(relativePath); + actualParts = actualParts.map(p => p.replace(/\\/g, '/')); + + assert.deepStrictEqual(actualParts, expectedParts); }); });