Skip to content

Commit

Permalink
test: cleanup test-child-process-constructor.js
Browse files Browse the repository at this point in the history
PR-URL: #12348
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
  • Loading branch information
cjihrig committed Apr 17, 2017
1 parent a9111f9 commit 59c6230
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-child-process-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

require('../common');
const assert = require('assert');
const child_process = require('child_process');
const ChildProcess = child_process.ChildProcess;
const { ChildProcess } = require('child_process');
assert.strictEqual(typeof ChildProcess, 'function');

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

assert.strictEqual(child.hasOwnProperty('pid'), true);
assert(Number.isInteger(child.pid));

// try killing with invalid signal
assert.throws(function() {
assert.throws(() => {
child.kill('foo');
}, /Unknown signal: foo/);
}, /^Error: Unknown signal: foo$/);

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

0 comments on commit 59c6230

Please sign in to comment.