Skip to content

Commit 3a460d5

Browse files
mattcphillipsFishrock123
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 <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 1ebb5b9 commit 3a460d5

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)