Skip to content

Commit

Permalink
switch back to furi, having learned spec is suitably complex
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Jan 20, 2019
1 parent 5d426c8 commit 3771060
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
13 changes: 10 additions & 3 deletions lib/report.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const Exclude = require('test-exclude')
const furi = require('furi')
const libCoverage = require('istanbul-lib-coverage')
const libReport = require('istanbul-lib-report')
const reports = require('istanbul-reports')
const { readdirSync, readFileSync } = require('fs')
const { isAbsolute, normalize, resolve } = require('path')
const { isAbsolute, resolve } = require('path')
// TODO: switch back to @c88/v8-coverage once patch is landed.
const { mergeProcessCovs } = require('@bcoe/v8-coverage')
const v8toIstanbul = require('v8-to-istanbul')
Expand Down Expand Up @@ -119,8 +120,14 @@ class Report {
_normalizeProcessCov (v8ProcessCov) {
const result = []
for (const v8ScriptCov of v8ProcessCov.result) {
v8ScriptCov.url = v8ScriptCov.url.replace(/^file:\/\//, '')
v8ScriptCov.url = normalize(v8ScriptCov.url)
if (/^file:\/\//.test(v8ScriptCov.url)) {
try {
v8ScriptCov.url = furi.toSysPath(v8ScriptCov.url)
} catch (err) {
console.warn(err)
continue
}
}
if (this.exclude.shouldInstrument(v8ScriptCov.url) &&
(!this.omitRelative || isAbsolute(v8ScriptCov.url))) {
result.push(v8ScriptCov)
Expand Down
30 changes: 22 additions & 8 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@bcoe/v8-coverage": "^0.1.0",
"find-up": "^3.0.0",
"foreground-child": "^1.5.6",
"furi": "^1.3.0",
"istanbul-lib-coverage": "^2.0.1",
"istanbul-lib-report": "^2.0.1",
"istanbul-reports": "^2.0.0",
Expand Down
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.18 | 72.22 | 95 | 95.18 | |
All files | 94.4 | 71.43 | 95 | 94.4 | |
bin | 88 | 62.5 | 100 | 88 | |
c8.js | 88 | 62.5 | 100 | 88 | 36,40,47,48,49,50 |
lib | 96.82 | 62.07 | 100 | 96.82 | |
lib | 95.59 | 61.29 | 100 | 95.59 | |
parse-args.js | 97.59 | 44.44 | 100 | 97.59 | 59,60 |
report.js | 96.35 | 70 | 100 | 96.35 | 59,60,98,99,100 |
report.js | 94.44 | 68.18 | 100 | 94.44 |... 01,127,128,129 |
test/fixtures | 95.16 | 94.12 | 85.71 | 95.16 | |
async.js | 100 | 100 | 100 | 100 | |
multiple-spawn.js | 100 | 100 | 100 | 100 | |
Expand Down

0 comments on commit 3771060

Please sign in to comment.