Skip to content

Commit

Permalink
fix: address file:// issue with CJS (bcoe#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Oct 21, 2018
1 parent 67959b4 commit d4f9cab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/report.js
Expand Up @@ -112,6 +112,8 @@ class Report {
_filterProcessCov (v8ProcessCov) {
const result = []
for (const v8ScriptCov of v8ProcessCov.result) {
// TODO: implement real fix from https://github.com/nodejs/node/issues/23783
v8ScriptCov.url = v8ScriptCov.url.replace(/^file:\/\//, '')
if (this.exclude.shouldInstrument(v8ScriptCov.url) &&
(!this.omitRelative || isAbsolute(v8ScriptCov.url))) {
result.push(v8ScriptCov)
Expand Down
6 changes: 3 additions & 3 deletions test/integration.js.snap
Expand Up @@ -8,12 +8,12 @@ second
--------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
--------------------|----------|----------|----------|----------|-------------------|
All files | 94.97 | 72.22 | 0 | 94.97 | |
All files | 95 | 72.22 | 0 | 95 | |
bin | 87.76 | 62.5 | 100 | 87.76 | |
c8.js | 87.76 | 62.5 | 100 | 87.76 | 35,39,46,47,48,49 |
lib | 96.62 | 62.07 | 100 | 96.62 | |
lib | 96.65 | 62.07 | 100 | 96.65 | |
parse-args.js | 97.47 | 44.44 | 100 | 97.47 | 55,56 |
report.js | 96.09 | 70 | 100 | 96.09 | 56,57,95,96,97 |
report.js | 96.15 | 70 | 100 | 96.15 | 56,57,95,96,97 |
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 d4f9cab

Please sign in to comment.