Skip to content

Commit 210290d

Browse files
mattcphillipsMylesBorins
authored andcommitted
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: #10026 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 4f5f0e4 commit 210290d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ assert.throws(function() { process.kill(+'not a number'); }, TypeError);
2424
assert.throws(function() { process.kill(1 / 0); }, TypeError);
2525
assert.throws(function() { process.kill(-1 / 0); }, TypeError);
2626

27+
// Test that kill throws an error for invalid signal
28+
29+
assert.throws(function() { process.kill(1, 'test'); }, Error);
30+
2731
// Test kill argument processing in valid cases.
2832
//
2933
// Monkey patch _kill so that we don't actually send any signals, particularly

0 commit comments

Comments
 (0)