diff --git a/.gitignore b/.gitignore index a4312877f..2a88247ec 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,5 @@ coverage node_modules !node_modules/spawn-wrap test/built-* -self_coverage +.self_coverage *.covered.js diff --git a/instrument-index.js b/build-self-coverage.js similarity index 100% rename from instrument-index.js rename to build-self-coverage.js diff --git a/lib/self-coverage-helper.js b/lib/self-coverage-helper.js index a4d12e1b0..dcd69bae8 100644 --- a/lib/self-coverage-helper.js +++ b/lib/self-coverage-helper.js @@ -10,7 +10,7 @@ onExit(function () { if (typeof ___nyc_self_coverage___ === 'object') coverage = ___nyc_self_coverage___ if (!coverage) return - var selfCoverageDir = path.join(__dirname, '../self_coverage') + var selfCoverageDir = path.join(__dirname, '../.self_coverage') mkdirp.sync(selfCoverageDir) fs.writeFileSync( path.join(selfCoverageDir, process.pid + '.json'), diff --git a/package.json b/package.json index 4bc55d2f2..2cbf2f9f0 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,15 @@ "description": "a code coverage tool that works well with subprocesses.", "main": "index.js", "scripts": { - "clean": "rm -rf ./.nyc_output && rm -rf ./test/fixtures/.nyc_output && rm -f ./index.covered.js ./lib/source-map-cache.covered.js && rm -rf ./self_coverage", - "build": "node ./build-tests", "pretest": "standard", "test": "npm run cover", - "cover": "npm run clean && npm run build && npm run instrument && npm run run-tests && npm run report", - "dev": "npm run clean && npm run build && npm run run-tests", - "instrument": "node ./instrument-index.js", + "clean": "rm -rf ./.nyc_output ./.self_coverage ./test/fixtures/.nyc_output && rm -f *covered.js ./lib/*covered.js test/built-*.js", + "build": "node ./build-tests", + "instrument": "node ./build-self-coverage.js", + "run-tests": "tap -b ./test/built-*.js ./test/source-map-cache.js", "report": "istanbul report --include=self_coverage/*.json lcov text", - "run-tests": "tap -b ./test/built-*.js ./test/source-map-cache.js" + "cover": "npm run clean && npm run build && npm run instrument && npm run run-tests && npm run report", + "dev": "npm run clean && npm run build && npm run run-tests" }, "bin": { "nyc": "./bin/nyc.js"