0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/test/parallel/test-child-process-constructor.js
k3kathy 3e387cd46e test: refactor test-child-process-constructor
Change all assert.equal() to use assert.strictEqual().

PR-URL: https://github.com/nodejs/node/pull/10060
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-12-04 19:54:01 -08:00

26 lines
596 B
JavaScript

'use strict';
require('../common');
var assert = require('assert');
var child_process = require('child_process');
var ChildProcess = child_process.ChildProcess;
assert.strictEqual(typeof ChildProcess, 'function');
// test that we can call spawn
var child = new ChildProcess();
child.spawn({
file: process.execPath,
args: ['--interactive'],
cwd: process.cwd(),
stdio: 'pipe'
});
assert.strictEqual(child.hasOwnProperty('pid'), true);
// try killing with invalid signal
assert.throws(function() {
child.kill('foo');
}, /Unknown signal: foo/);
assert.strictEqual(child.kill(), true);