We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 62054ae commit a8b1c8bCopy full SHA for a8b1c8b
1 file changed
test/webserver.mjs
@@ -306,7 +306,15 @@ class WebServer {
306
307
// Transform with Babel and istanbul plugin
308
const result = babel.transformSync(content, {
309
- filename: fileURL.pathname,
+ // On Windows, the file URL starts with a slash (e.g.
310
+ // /C:/path/to/file.js).
311
+ // This leading slash makes the file path invalid and causes the
312
+ // instrumentation to fail, so we need to remove it before passing the
313
+ // path.
314
+ filename:
315
+ process.platform === "win32"
316
+ ? fileURL.pathname.substring(1)
317
+ : fileURL.pathname,
318
plugins: ["babel-plugin-istanbul"],
319
sourceMaps: false,
320
});
0 commit comments