diff --git a/packages/stryker/src/isolated-runner/IsolatedTestRunnerAdapter.ts b/packages/stryker/src/isolated-runner/IsolatedTestRunnerAdapter.ts index f83bb722eb..7183d74df9 100644 --- a/packages/stryker/src/isolated-runner/IsolatedTestRunnerAdapter.ts +++ b/packages/stryker/src/isolated-runner/IsolatedTestRunnerAdapter.ts @@ -116,7 +116,7 @@ export default class TestRunnerChildProcessAdapter extends EventEmitter implemen this.currentTask = new DisposeTask(MAX_WAIT_FOR_DISPOSE); this.sendDisposeCommand(); return this.currentTask.promise - .then(() => this.workerProcess.kill('SIGKILL')); + .then(() => this.workerProcess.kill()); } private sendRunCommand(options: RunOptions) { diff --git a/packages/stryker/test/unit/isolated-runner/IsolatedTestRunnerAdapterSpec.ts b/packages/stryker/test/unit/isolated-runner/IsolatedTestRunnerAdapterSpec.ts index 12639a38e4..609c0dd891 100644 --- a/packages/stryker/test/unit/isolated-runner/IsolatedTestRunnerAdapterSpec.ts +++ b/packages/stryker/test/unit/isolated-runner/IsolatedTestRunnerAdapterSpec.ts @@ -124,15 +124,17 @@ describe('IsolatedTestRunnerAdapter', () => { return expect(fakeChildProcess.send).to.have.been.calledWith(serialize({ kind: 'dispose' })); }); - describe('and child process responses to dispose', () => { + describe('and child process responds to dispose', () => { beforeEach(() => { const promise = sut.dispose(); receiveMessage({ kind: 'disposeDone' }); return promise; }); - it('should kill the child process', () => - expect(fakeChildProcess.kill).to.have.been.calledWith()); + it('should kill the child process', () => { + expect(fakeChildProcess.kill).to.not.have.been.calledWith('SIGKILL'); + expect(fakeChildProcess.kill).to.have.been.called; + }); }); describe('and a timeout occurred', () => { @@ -144,8 +146,10 @@ describe('IsolatedTestRunnerAdapter', () => { return promise; }); - it('should kill the child process', () => - expect(fakeChildProcess.kill).to.have.been.calledWith('SIGKILL')); + it('should kill the child process', () => { + expect(fakeChildProcess.kill).to.not.have.been.calledWith('SIGKILL'); + expect(fakeChildProcess.kill).to.have.been.called; + }); }); }); it('should reject any exceptions', () => {