From 58e10642f4f099d7b8132f20ff59a85ed6a9443c Mon Sep 17 00:00:00 2001 From: naugtur Date: Wed, 22 Jun 2022 14:16:33 +0200 Subject: [PATCH] fix(compartment-mapper): adapt require.resolve assertion to Windows also --- .../fixtures-cjs-compat/node_modules/require-resolve/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/compartment-mapper/test/fixtures-cjs-compat/node_modules/require-resolve/main.js b/packages/compartment-mapper/test/fixtures-cjs-compat/node_modules/require-resolve/main.js index 065f95a991..9f4ff3693d 100644 --- a/packages/compartment-mapper/test/fixtures-cjs-compat/node_modules/require-resolve/main.js +++ b/packages/compartment-mapper/test/fixtures-cjs-compat/node_modules/require-resolve/main.js @@ -1,6 +1,9 @@ const adaptToAssertions = (f) => { try { - return (f()).replace(/^.*compartment-mapper\/test/,'/skipped'); + let result = f(); + result = result.replace(/\\/g,'/'); + result = result.replace(/^.*compartment-mapper\/test/,'/skipped'); + return result; } catch (e) { return e.message.split('\n')[0]; }