Skip to content

Commit 2463d5f

Browse files
committed
#224: spec/lib/runner.js: killProcessFamily() now works on Windows (using taskkill.exe)
1 parent 5f3ce28 commit 2463d5f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/lib/runner.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ var matchesSpecs = function(output, specs) {
1818

1919
// kill the process family described by process, then send done the error
2020
var killProcessFamily = function(child, error, done) {
21+
if (process.platform === 'win32') {
22+
// We do not use /PID <pid>, because it will fail if process was already terminated
23+
exec('taskkill /F /T /FI "PID eq ' + child.pid + '"', function(killErr) {
24+
done(error || killErr);
25+
});
26+
return;
27+
}
2128
// we need to grab a table of process ids and parent ids to form a tree out of
2229
exec('ps -opid -oppid', function(err, rawData) {
2330
// parse the list of process ids and parent ids

0 commit comments

Comments
 (0)