We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9111f9 commit 59c6230Copy full SHA for 59c6230
test/parallel/test-child-process-constructor.js
@@ -2,8 +2,7 @@
2
3
require('../common');
4
const assert = require('assert');
5
-const child_process = require('child_process');
6
-const ChildProcess = child_process.ChildProcess;
+const { ChildProcess } = require('child_process');
7
assert.strictEqual(typeof ChildProcess, 'function');
8
9
// test that we can call spawn
@@ -16,10 +15,11 @@ child.spawn({
16
15
});
17
18
assert.strictEqual(child.hasOwnProperty('pid'), true);
+assert(Number.isInteger(child.pid));
19
20
// try killing with invalid signal
21
-assert.throws(function() {
+assert.throws(() => {
22
child.kill('foo');
23
-}, /Unknown signal: foo/);
+}, /^Error: Unknown signal: foo$/);
24
25
assert.strictEqual(child.kill(), true);
0 commit comments