From 76fb50fc8e2fb0fee28ea6abad7ba1dd44ea982e Mon Sep 17 00:00:00 2001 From: popomore Date: Tue, 25 Oct 2016 20:25:15 +0800 Subject: [PATCH] fix: wait 1 second for Windows --- lib/cov_command.js | 4 ++++ package.json | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/cov_command.js b/lib/cov_command.js index ea2118f6..1bce3e54 100644 --- a/lib/cov_command.js +++ b/lib/cov_command.js @@ -3,6 +3,7 @@ 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 { @@ -43,6 +44,9 @@ class CovCommand extends Command { yield this.helper.forkNode(covFile, covArgs, opt); rimraf.sync(process.env.TMPDIR); + // wait 1 second for Windows + yield sleep(1000); + // create coverage report const reportArgs = this.getReportArgs(coverageDir); yield this.helper.forkNode(covFile, reportArgs, opt); diff --git a/package.json b/package.json index c462786b..f1d19c9a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "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",