From 6aacef730096fc2b5850acec7ed280c396124e95 Mon Sep 17 00:00:00 2001 From: Matt Phillips Date: Thu, 1 Dec 2016 11:32:45 -0600 Subject: [PATCH] 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 Reviewed-By: Jeremiah Senkpiel Reviewed-By: Colin Ihrig --- test/parallel/test-process-kill-pid.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index 5c11be2903c4a7..ee0554c32083f6 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/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); +// 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