Skip to content

Commit

Permalink
Merge 8cbba15 into 7fd9e13
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Jan 20, 2019
2 parents 7fd9e13 + 8cbba15 commit d92c75d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
language: node_js
os:
- linux
- osx
# need to figure out why offsets
# are slightly off on Windows.
- windows
node_js:
- "10.10"
after_success: npm run coverage
- "11"
after_success: npm run coverage
11 changes: 5 additions & 6 deletions lib/report.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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 { resolve, isAbsolute } = require('path')
const { mergeProcessCovs } = require('@c88/v8-coverage')
const { isAbsolute, normalize, 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')

class Report {
Expand Down Expand Up @@ -119,9 +119,8 @@ class Report {
_normalizeProcessCov (v8ProcessCov) {
const result = []
for (const v8ScriptCov of v8ProcessCov.result) {
if (/^file:\/\//.test(v8ScriptCov.url)) {
v8ScriptCov.url = furi.toSysPath(v8ScriptCov.url)
}
v8ScriptCov.url = v8ScriptCov.url.replace(/^file:\/\//, '')
v8ScriptCov.url = normalize(v8ScriptCov.url)
if (this.exclude.shouldInstrument(v8ScriptCov.url) &&
(!this.omitRelative || isAbsolute(v8ScriptCov.url))) {
result.push(v8ScriptCov)
Expand Down
17 changes: 11 additions & 6 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c8",
"version": "3.2.1",
"version": "3.3.0-candidate.2",
"description": "output coverage reports using Node.js' built in coverage",
"main": "index.js",
"bin": "./bin/c8.js",
Expand Down Expand Up @@ -32,10 +32,9 @@
"author": "Ben Coe <ben@npmjs.com>",
"license": "ISC",
"dependencies": {
"@c88/v8-coverage": "^0.1.0",
"@bcoe/v8-coverage": "^0.1.0",
"find-up": "^3.0.0",
"foreground-child": "^1.5.6",
"furi": "^1.0.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 | 94.59 | 70.91 | 0 | 94.59 | |
All files | 95.18 | 72.22 | 0 | 95.18 | |
bin | 88 | 62.5 | 100 | 88 | |
c8.js | 88 | 62.5 | 100 | 88 | 36,40,47,48,49,50 |
lib | 95.93 | 60 | 100 | 95.93 | |
lib | 96.82 | 62.07 | 100 | 96.82 | |
parse-args.js | 97.59 | 44.44 | 100 | 97.59 | 59,60 |
report.js | 94.93 | 66.67 | 100 | 94.93 |... 99,100,123,124 |
report.js | 96.35 | 70 | 100 | 96.35 | 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 d92c75d

Please sign in to comment.