mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
fix: support .mjs files with Playwright Inspector (#10043)
This commit is contained in:
parent
b177e6450a
commit
ceedf45d4a
@ -72,7 +72,12 @@ export function captureStackTrace(): ParsedStackTrace {
|
|||||||
return null;
|
return null;
|
||||||
if (frame.file.startsWith(WS_LIB))
|
if (frame.file.startsWith(WS_LIB))
|
||||||
return null;
|
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')))
|
if (isTesting && fileName.includes(path.join('playwright', 'tests', 'config', 'coverage.js')))
|
||||||
return null;
|
return null;
|
||||||
const inClient = fileName.startsWith(CLIENT_LIB) || fileName.startsWith(CLIENT_SRC);
|
const inClient = fileName.startsWith(CLIENT_LIB) || fileName.startsWith(CLIENT_SRC);
|
||||||
|
Loading…
Reference in New Issue
Block a user