Skip to content

Commit

Permalink
feat: use test when run cov on Windows (#18)
Browse files Browse the repository at this point in the history
it is wired to generate coverage on Windows

eggjs/egg#133 (comment)
  • Loading branch information
popomore authored and fengmk2 committed Oct 28, 2016
1 parent 860e18d commit 611027f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 0 additions & 6 deletions lib/cov_command.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const path = require('path');
const mkdirp = require('mkdirp');
const rimraf = require('rimraf');
const sleep = require('ko-sleep');
const Command = require('./command');

class CovCommand extends Command {
Expand Down Expand Up @@ -44,11 +43,6 @@ class CovCommand extends Command {
yield this.helper.forkNode(covFile, covArgs, opt);
rimraf.sync(process.env.TMPDIR);

// wait 5 second for Windows
if (process.platform === 'win32') {
yield sleep(5000);
}

// create coverage report
const reportArgs = this.getReportArgs(coverageDir);
yield this.helper.forkNode(covFile, reportArgs, opt);
Expand Down
6 changes: 5 additions & 1 deletion lib/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ class Program extends BaseProgram {
this.addCommand('dev', path.join(__dirname, 'dev_command.js'));
this.addCommand('debug', path.join(__dirname, 'debug_command.js'));
this.addCommand('test', path.join(__dirname, 'test_command.js'));
this.addCommand('cov', path.join(__dirname, 'cov_command.js'));
if (process.platform === 'win32') {
this.addCommand('cov', path.join(__dirname, 'test_command.js'));
} else {
this.addCommand('cov', path.join(__dirname, 'cov_command.js'));
}
}
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"egg-utils": "^1.0.0",
"glob": "^7.1.1",
"istanbul": "^0.4.0",
"ko-sleep": "^1.0.2",
"mkdirp": "^0.5.1",
"mocha": "^3.0.0",
"rimraf": "^2.5.4",
Expand Down

0 comments on commit 611027f

Please sign in to comment.