Skip to content

Commit

Permalink
fix: support .mjs files with Playwright Inspector (#10043)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Nov 5, 2021
1 parent b177e64 commit ceedf45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/playwright-core/src/utils/stackTrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ export function captureStackTrace(): ParsedStackTrace {
return null;
if (frame.file.startsWith(WS_LIB))
return null;
const fileName = path.resolve(process.cwd(), frame.file);
// Workaround for https://github.com/tapjs/stack-utils/issues/60
let fileName: string;
if (frame.file.startsWith('file://'))
fileName = new URL(frame.file).pathname;
else
fileName = path.resolve(process.cwd(), frame.file);
if (isTesting && fileName.includes(path.join('playwright', 'tests', 'config', 'coverage.js')))
return null;
const inClient = fileName.startsWith(CLIENT_LIB) || fileName.startsWith(CLIENT_SRC);
Expand Down

0 comments on commit ceedf45

Please sign in to comment.