From 59c623086173cb28c887c5c54f213e067d6f8784 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 11 Apr 2017 16:01:00 -0400 Subject: [PATCH] test: cleanup test-child-process-constructor.js PR-URL: https://github.com/nodejs/node/pull/12348 Reviewed-By: James M Snell Reviewed-By: Santiago Gimeno --- test/parallel/test-child-process-constructor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index d33c7ae3acf626..e39bdf867d200b 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -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);