From 264364a152b9ac4ceb67abe848be085675b7e1e0 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Fri, 29 Sep 2023 14:49:54 +0000 Subject: [PATCH] Fix tests for windows --- test/cli.test.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cli.test.mjs b/test/cli.test.mjs index 4006c73..ba7d403 100644 --- a/test/cli.test.mjs +++ b/test/cli.test.mjs @@ -750,10 +750,10 @@ t.describe('CLI', function() { assert.ok(eltro.starting) assert.strictEqual(loaded.length, 2) - assert.match(loaded[0], path.join('root', testFiles[1])) - assert.match(loaded[1], path.join('root', testFiles[2])) - assert.match(filenames[0], testFiles[1]) - assert.match(filenames[1], testFiles[2]) + assert.match(loaded[0], new RegExp(path.join('root', testFiles[1]).replace(/\\/g, '\\\\'))) + assert.match(loaded[1], new RegExp(path.join('root', testFiles[2]).replace(/\\/g, '\\\\'))) + assert.match(filenames[0], new RegExp(testFiles[1].replace(/\\/g, '\\\\'))) + assert.match(filenames[1], new RegExp(testFiles[2].replace(/\\/g, '\\\\'))) }) t.test('on error should throw and wrap in inner error', async function() {