diff --git a/packages/babel-core/test/errors-stacks.js b/packages/babel-core/test/errors-stacks.js index 23de8b5393d0..cf9dc0f26dde 100644 --- a/packages/babel-core/test/errors-stacks.js +++ b/packages/babel-core/test/errors-stacks.js @@ -12,8 +12,10 @@ function expectError(run) { run(); } catch (e) { let { stack } = e; + // Normalize windows paths + stack = stack.replace(/\\/g, "/"); // Remove absolute URLs - stack = replaceAll(stack, process.cwd(), ""); + stack = replaceAll(stack, process.cwd().replace(/\\/g, "/"), ""); stack = replaceAll(stack, "file://", ""); // Remove jest-related stack frames. // The `at async Promise.all` frame comes from inside jest-light-runner and is only