Skip to content

Commit 59c6230

Browse files
committed
test: cleanup test-child-process-constructor.js
PR-URL: #12348 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
1 parent a9111f9 commit 59c6230

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-child-process-constructor.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
require('../common');
44
const assert = require('assert');
5-
const child_process = require('child_process');
6-
const ChildProcess = child_process.ChildProcess;
5+
const { ChildProcess } = require('child_process');
76
assert.strictEqual(typeof ChildProcess, 'function');
87

98
// test that we can call spawn
@@ -16,10 +15,11 @@ child.spawn({
1615
});
1716

1817
assert.strictEqual(child.hasOwnProperty('pid'), true);
18+
assert(Number.isInteger(child.pid));
1919

2020
// try killing with invalid signal
21-
assert.throws(function() {
21+
assert.throws(() => {
2222
child.kill('foo');
23-
}, /Unknown signal: foo/);
23+
}, /^Error: Unknown signal: foo$/);
2424

2525
assert.strictEqual(child.kill(), true);

0 commit comments

Comments
 (0)