diff --git a/lib/reporters.js b/lib/reporters.js index 236698a..ecedc04 100644 --- a/lib/reporters.js +++ b/lib/reporters.js @@ -5,7 +5,13 @@ function normalizeFile (file, cwd) { let res = file console.log('---', file) if (file.startsWith('file://')) { - res = fileURLToPath(new URL(file)) + try { + res = fileURLToPath(new URL(file)) + } catch (err) { + if (err.code === 'ERR_INVALID_FILE_URL_PATH') { + res = fileURLToPath(new URL(file.replace('file:///', 'file://'))) + } + } } res = res.replace(cwd, '') if (res.startsWith('/') || res.startsWith('\\')) {