Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Jan 30, 2024
1 parent 3545a3d commit bf63ec9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/reporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('\\')) {
Expand Down

0 comments on commit bf63ec9

Please sign in to comment.