From d59074c1cbf7c03f90bb5d850036f6153fe9464d Mon Sep 17 00:00:00 2001 From: Pavol Otcenas Date: Sat, 17 Sep 2016 10:30:29 +0200 Subject: [PATCH] test: modernize JS and tighten equality checking Changed var --> const and let. Changed assert.equal !== --> assert.notStrictEqual Correctly aligned argument PR-URL: https://github.com/nodejs/node/pull/8580 Reviewed-By: Robert Jefe Lindstaedt Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- test/parallel/test-child-process-detached.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-child-process-detached.js b/test/parallel/test-child-process-detached.js index 97de4881eb6..b4cb8f41360 100644 --- a/test/parallel/test-child-process-detached.js +++ b/test/parallel/test-child-process-detached.js @@ -1,21 +1,21 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); -var spawn = require('child_process').spawn; -var childPath = path.join(common.fixturesDir, - 'parent-process-nonpersistent.js'); -var persistentPid = -1; +const spawn = require('child_process').spawn; +const childPath = path.join(common.fixturesDir, + 'parent-process-nonpersistent.js'); +let persistentPid = -1; -var child = spawn(process.execPath, [ childPath ]); +const child = spawn(process.execPath, [ childPath ]); child.stdout.on('data', function(data) { persistentPid = parseInt(data, 10); }); process.on('exit', function() { - assert(persistentPid !== -1); + assert.notStrictEqual(persistentPid, -1); assert.throws(function() { process.kill(child.pid); });