Comparing version 3.1.0 to 3.2.0
@@ -21,4 +21,6 @@ #!/usr/bin/env node | ||
} else { | ||
rimraf.sync(argv.tempDirectory) | ||
mkdirp.sync(argv.tempDirectory) | ||
if (argv.clean) { | ||
rimraf.sync(argv.tempDirectory) | ||
mkdirp.sync(argv.tempDirectory) | ||
} | ||
process.env.NODE_V8_COVERAGE = argv.tempDirectory | ||
@@ -25,0 +27,0 @@ |
@@ -5,2 +5,18 @@ # Change Log | ||
<a name="3.2.0"></a> | ||
# [3.2.0](https://github.com/bcoe/c8/compare/v3.1.0...v3.2.0) (2018-09-16) | ||
### Bug Fixes | ||
* make tests run on Windows ([#25](https://github.com/bcoe/c8/issues/25)) ([08e44d0](https://github.com/bcoe/c8/commit/08e44d0)) | ||
### Features | ||
* improve test assertions ([#28](https://github.com/bcoe/c8/issues/28)) ([522720e](https://github.com/bcoe/c8/commit/522720e)) | ||
* warn instead of throw on exception ([#29](https://github.com/bcoe/c8/issues/29)) ([a8620d4](https://github.com/bcoe/c8/commit/a8620d4)) | ||
<a name="3.1.0"></a> | ||
@@ -7,0 +23,0 @@ # [3.1.0](https://github.com/bcoe/c8/compare/v3.0.3...v3.1.0) (2018-09-11) |
@@ -27,6 +27,2 @@ const Exclude = require('test-exclude') | ||
}) | ||
.option('coverage-directory', { | ||
default: './coverage', | ||
describe: 'directory to output coverage JSON and reports' | ||
}) | ||
.option('temp-directory', { | ||
@@ -45,2 +41,7 @@ default: './coverage/tmp', | ||
}) | ||
.option('clean', { | ||
default: true, | ||
type: 'boolean', | ||
describe: 'should temp files be deleted before script execution' | ||
}) | ||
.command('report', 'read V8 coverage data from temp and output report') | ||
@@ -47,0 +48,0 @@ .pkgConf('c8') |
@@ -63,7 +63,11 @@ const Exclude = require('test-exclude') | ||
Object.keys(mergedResults).forEach((url) => { | ||
const result = mergedResults[url] | ||
const path = resolve(this.resolve, result.url) | ||
const script = v8toIstanbul(path) | ||
script.applyCoverage(result.functions) | ||
map.merge(script.toIstanbul()) | ||
try { | ||
const result = mergedResults[url] | ||
const path = resolve(this.resolve, result.url) | ||
const script = v8toIstanbul(path) | ||
script.applyCoverage(result.functions) | ||
map.merge(script.toIstanbul()) | ||
} catch (err) { | ||
console.warn(`file: ${url} error: ${err.stack}`) | ||
} | ||
}) | ||
@@ -77,6 +81,10 @@ | ||
return files.map((f) => { | ||
return JSON.parse(readFileSync( | ||
resolve(this.tempDirectory, f), | ||
'utf8' | ||
)) | ||
try { | ||
return JSON.parse(readFileSync( | ||
resolve(this.tempDirectory, f), | ||
'utf8' | ||
)) | ||
} catch (err) { | ||
console.warn(`${err.stack}`) | ||
} | ||
}) | ||
@@ -83,0 +91,0 @@ } |
{ | ||
"name": "c8", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "output coverage reports using Node.js' built in coverage", | ||
@@ -12,3 +12,4 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "./bin/c8.js --reporter=html --reporter=text mocha ./test/*.js", | ||
"test": "node ./bin/c8.js --reporter=html --reporter=text mocha ./test/*.js", | ||
"test:snap": "CHAI_JEST_SNAPSHOT_UPDATE_ALL=true npm test", | ||
"posttest": "standard", | ||
@@ -51,2 +52,3 @@ "coverage": "./bin/c8.js report --reporter=text-lcov | coveralls", | ||
"chai": "^4.1.2", | ||
"chai-jest-snapshot": "^2.0.0", | ||
"coveralls": "^3.0.2", | ||
@@ -53,0 +55,0 @@ "mocha": "^5.2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11758
195
6