Skip to content

Commit 9d59702

Browse files
committed
fix windows path
1 parent 6352420 commit 9d59702

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/core/src/runtime/runner/runtime.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'node:path';
12
import { fileURLToPath } from 'node:url';
23
import { parse as stackTraceParse } from 'stacktrace-parser';
34
import type {
@@ -494,8 +495,10 @@ export const createRuntimeAPI = ({
494495
if (stack) {
495496
const frames = stackTraceParse(stack);
496497
for (const frame of frames) {
497-
let filename = frame.file;
498-
if (filename?.startsWith('file://')) filename = fileURLToPath(filename);
498+
let filename = frame.file ?? '';
499+
if (filename.startsWith('file://')) filename = fileURLToPath(filename);
500+
// testPath is always unix path style, so convert filename with same way
501+
filename = filename.replaceAll(path.sep, '/');
499502
if (filename === testPath) {
500503
const line = frame.lineNumber;
501504
const column = frame.column;

0 commit comments

Comments
 (0)