diff --git a/src/TestRunner.ts b/src/TestRunner.ts index 85e3e46..5ed0311 100644 --- a/src/TestRunner.ts +++ b/src/TestRunner.ts @@ -1,6 +1,7 @@ import { spawn, ChildProcess } from 'child_process'; import { resolve } from 'path'; import { window, workspace, FileSystemWatcher } from 'vscode'; +import * as os from 'os'; const debounce = require('lodash.debounce'); const kill = require('tree-kill'); @@ -153,7 +154,8 @@ export class TestRunner { const showCoverage = NodeTDD.getConfig(config.SHOW_COVERAGE); const reporter = NodeTDD.getConfig(config.REPORTER); - this.process = spawn('npm', this.testCommand, { cwd: workspace.rootPath, detached: true }); + var isWindowsPlatform = os.platform() === 'win32'; + this.process = spawn( isWindowsPlatform ? 'npm.cmd' : 'npm', this.testCommand, { cwd: workspace.rootPath, detached: isWindowsPlatform ? false : true }); this.process.unref();