test: cleanup test-child-process-constructor.js

PR-URL: https://github.com/nodejs/node/pull/12348
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
cjihrig 2017-04-11 16:01:00 -04:00
parent a9111f9738
commit 59c6230861

View File

@ -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
@ -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);