Skip to content

Commit

Permalink
test: cleanup test-child-process-exec-env.js
Browse files Browse the repository at this point in the history
Replace equal with strictEqual, use const instead of var and
improve test with use of assert.notStrictEqual

PR-URL: #8600
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
  • Loading branch information
sejoker authored and Fishrock123 committed Oct 11, 2016
1 parent 3269a7d commit c98d0c9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/parallel/test-child-process-exec-env.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
'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) {
error_count++;
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);
}
}

Expand All @@ -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);
});

0 comments on commit c98d0c9

Please sign in to comment.