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 Fishrock123 committed Dec 13, 2016
1 parent 1ebb5b9 commit 3a460d5
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 3a460d5

Please sign in to comment.