Browse Source

test: check for error on invalid signal

Asserts that an error should be thrown when
an invalid signal is passed to process.kill().

PR-URL: https://github.com/nodejs/node/pull/10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6
Matt Phillips 8 years ago
committed by Rich Trott
parent
commit
6aacef7300
  1. 4
      test/parallel/test-process-kill-pid.js

4
test/parallel/test-process-kill-pid.js

@ -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);
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. // Test kill argument processing in valid cases.
// //
// Monkey patch _kill so that we don't actually send any signals, particularly // Monkey patch _kill so that we don't actually send any signals, particularly

Loading…
Cancel
Save