Skip to content

Commit

Permalink
fix: do not attempt to repair broken URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jan 31, 2024
1 parent c7c99c1 commit 2bdf92b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/reporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ import { fileURLToPath } from 'node:url'
function normalizeFile (file, cwd) {
let res = file
if (file.startsWith('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 = fileURLToPath(file)
}
res = res.replace(cwd, '')
if (res.startsWith('/') || res.startsWith('\\')) {
Expand Down

0 comments on commit 2bdf92b

Please sign in to comment.