Skip to content

Commit

Permalink
fix(cov): istanbul path env (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 authored and popomore committed Mar 21, 2017
1 parent a7b7ad8 commit ce8f141
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/cmd/cov.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ class CovCommand extends Command {
process.env.NODE_ENV = 'test';
process.env.TMPDIR = tmpDir;

const opt = {
env: Object.assign({}, process.env),
execArgv,
};

// istanbul coverage ignore
const excludes = argv.x || (process.env.COV_EXCLUDES && process.env.COV_EXCLUDES.split(',')) || [];
for (const exclude of excludes) {
Expand All @@ -54,12 +49,17 @@ class CovCommand extends Command {
argv.x = undefined;

const covFile = require.resolve('istanbul/lib/cli.js');
// resolve istanbul path for coffee
/* istanbul ignore next */
process.env.istanbul_bin_path = covFile;
const coverageDir = path.join(cwd, 'coverage');
yield rimraf(coverageDir);

const opt = {
execArgv,
// resolve istanbul path for coffee
env: Object.assign({
istanbul_bin_path: covFile,
}, process.env),
};

// save coverage-xxxx.json to $PWD/coverage
const covArgs = this.getCovArgs(argv);
debug('covArgs: %j', covArgs);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"glob": "^7.1.1",
"globby": "^6.1.0",
"intelli-espower-loader": "^1.0.1",
"is-type-of": "^1.0.0",
"istanbul": "^1.1.0-alpha.1",
"mocha": "^3.2.0",
"mz-modules": "^1.0.0",
Expand Down

0 comments on commit ce8f141

Please sign in to comment.