Skip to content
Permalink
Browse files
Fix killSignal option (#93)
  • Loading branch information
kevva authored and sindresorhus committed Jun 7, 2017
1 parent 3534037 commit 2cbcc5c869a9e5fd7e12d8fb32c4d4e579f0e7d5
Showing 2 changed files with 7 additions and 1 deletion.
@@ -157,7 +157,7 @@ module.exports = (cmd, args, opts) => {
timeoutId = setTimeout(() => {
timeoutId = null;
timedOut = true;
spawned.kill(parsed.killSignal);
spawned.kill(parsed.opts.killSignal);
}, parsed.opts.timeout);
}

@@ -284,6 +284,12 @@ if (process.platform !== 'win32') {

t.is(err.signal, 'SIGTERM');
});

test('custom err.signal', async t => {
const err = await t.throws(m('delay', ['3000', '0'], {killSignal: 'SIGHUP', timeout: 1500}));

t.is(err.signal, 'SIGHUP');
});
}

test('result.signal is null for successful execution', async t => {

0 comments on commit 2cbcc5c

Please sign in to comment.