Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extension stuck on building on windows platform #17

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/TestRunner.ts
Original file line number Diff line number Diff line change
@@ -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');

Expand Down Expand Up @@ -153,7 +154,8 @@ export class TestRunner {
const showCoverage = NodeTDD.getConfig<boolean>(config.SHOW_COVERAGE);
const reporter = NodeTDD.getConfig<string | null>(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();

Expand Down