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>
This commit is contained in:
Matt Phillips authored and Myles Borins committed 2017-01-31 20:04:27 -05:00
1 parent 4f5f0e4975
commit 210290dfba
1 file changed
+4
+4
View File
@@ -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