Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cb63808

Browse filesBrowse files
QueueHefnergibfahn
authored andcommitted
test: improve test-process-kill-pid
PR-URL: #12588 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent ac825fc commit cb63808
Copy full SHA for cb63808

File tree

Expand file treeCollapse file tree

1 file changed

+11
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-7
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-process-kill-pid.js
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@ const assert = require('assert');
1717
//
1818
// process.pid, String(process.pid): ourself
1919

20-
assert.throws(function() { process.kill('SIGTERM'); }, TypeError);
21-
assert.throws(function() { process.kill(null); }, TypeError);
22-
assert.throws(function() { process.kill(undefined); }, TypeError);
23-
assert.throws(function() { process.kill(+'not a number'); }, TypeError);
24-
assert.throws(function() { process.kill(1 / 0); }, TypeError);
25-
assert.throws(function() { process.kill(-1 / 0); }, TypeError);
20+
assert.throws(function() { process.kill('SIGTERM'); },
21+
/^TypeError: invalid pid$/);
22+
assert.throws(function() { process.kill(null); }, /^TypeError: invalid pid$/);
23+
assert.throws(function() { process.kill(undefined); },
24+
/^TypeError: invalid pid$/);
25+
assert.throws(function() { process.kill(+'not a number'); },
26+
/^TypeError: invalid pid$/);
27+
assert.throws(function() { process.kill(1 / 0); }, /^TypeError: invalid pid$/);
28+
assert.throws(function() { process.kill(-1 / 0); }, /^TypeError: invalid pid$/);
2629

2730
// Test that kill throws an error for invalid signal
2831

29-
assert.throws(function() { process.kill(1, 'test'); }, Error);
32+
assert.throws(function() { process.kill(1, 'test'); },
33+
/^Error: Unknown signal: test$/);
3034

3135
// Test kill argument processing in valid cases.
3236
//

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.