From c98d0c984dc9d4433e41a3180f66277509af5df7 Mon Sep 17 00:00:00 2001 From: Yevgen Safronov Date: Sat, 17 Sep 2016 11:40:06 +0200 Subject: [PATCH] test: cleanup test-child-process-exec-env.js Replace equal with strictEqual, use const instead of var and improve test with use of assert.notStrictEqual PR-URL: https://github.com/nodejs/node/pull/8600 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Ilkka Myller --- test/parallel/test-child-process-exec-env.js | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-child-process-exec-env.js b/test/parallel/test-child-process-exec-env.js index e80531e87e..6af3bea211 100644 --- a/test/parallel/test-child-process-exec-env.js +++ b/test/parallel/test-child-process-exec-env.js @@ -1,11 +1,11 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var exec = require('child_process').exec; -var success_count = 0; -var error_count = 0; -var response = ''; -var child; +const common = require('../common'); +const assert = require('assert'); +const exec = require('child_process').exec; +let success_count = 0; +let error_count = 0; +let response = ''; +let child; function after(err, stdout, stderr) { if (err) { @@ -13,10 +13,10 @@ function after(err, stdout, stderr) { console.log('error!: ' + err.code); console.log('stdout: ' + JSON.stringify(stdout)); console.log('stderr: ' + JSON.stringify(stderr)); - assert.equal(false, err.killed); + assert.strictEqual(false, err.killed); } else { success_count++; - assert.equal(true, stdout != ''); + assert.notStrictEqual('', stdout); } } @@ -33,7 +33,7 @@ child.stdout.on('data', function(chunk) { process.on('exit', function() { console.log('response: ', response); - assert.equal(1, success_count); - assert.equal(0, error_count); + assert.strictEqual(1, success_count); + assert.strictEqual(0, error_count); assert.ok(response.indexOf('HELLO=WORLD') >= 0); });