Skip to content

Commit

Permalink
fix: do not attempt to repair broken URLs (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Feb 1, 2024
1 parent c7c99c1 commit d61b54c
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 d61b54c

Please sign in to comment.