Skip to content

Commit

Permalink
test: check for error on invalid signal
Browse files Browse the repository at this point in the history
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().

PR-URL: #10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
mattcphillips authored and MylesBorins committed Feb 1, 2017
1 parent 4f5f0e4 commit 210290d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/parallel/test-process-kill-pid.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ assert.throws(function() { process.kill(+'not a number'); }, TypeError);
assert.throws(function() { process.kill(1 / 0); }, TypeError);
assert.throws(function() { process.kill(-1 / 0); }, TypeError);

// Test that kill throws an error for invalid signal

assert.throws(function() { process.kill(1, 'test'); }, Error);

// Test kill argument processing in valid cases.
//
// Monkey patch _kill so that we don't actually send any signals, particularly
Expand Down

0 comments on commit 210290d

Please sign in to comment.