Skip to content

Commit

Permalink
fix: actually replace path correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Jan 20, 2019
1 parent 6c8c57e commit 64de0c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
4 changes: 3 additions & 1 deletion lib/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ class Report {
_normalizeProcessCov (v8ProcessCov) {
const result = []
for (const v8ScriptCov of v8ProcessCov.result) {
v8ScriptCov.url = v8ScriptCov.url.replace(/^file:[\/]+/, '')
if (/^file:[\\/]{2}/.test(v8ScriptCov.url)) {
v8ScriptCov.url = v8ScriptCov.url.replace(/^file:[\\/]{2}/, '')
}
if (this.exclude.shouldInstrument(v8ScriptCov.url) &&
(!this.omitRelative || isAbsolute(v8ScriptCov.url))) {
result.push(v8ScriptCov)
Expand Down
19 changes: 0 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions test/integration.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ second
--------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
--------------------|----------|----------|----------|----------|-------------------|
All files | 95.21 | 72.73 | 0 | 95.21 | |
All files | 95.2 | 72.73 | 0 | 95.2 | |
bin | 88 | 62.5 | 100 | 88 | |
c8.js | 88 | 62.5 | 100 | 88 | 36,40,47,48,49,50 |
lib | 96.85 | 63.33 | 100 | 96.85 | |
lib | 96.83 | 63.33 | 100 | 96.83 | |
parse-args.js | 97.59 | 44.44 | 100 | 97.59 | 59,60 |
report.js | 96.4 | 71.43 | 100 | 96.4 | 60,61,99,100,101 |
report.js | 96.38 | 71.43 | 100 | 96.38 | 59,60,98,99,100 |
test/fixtures | 95.16 | 94.12 | 0 | 95.16 | |
async.js | 100 | 100 | 100 | 100 | |
multiple-spawn.js | 100 | 100 | 100 | 100 | |
Expand Down

0 comments on commit 64de0c5

Please sign in to comment.