From a1bd070f87bfb7d32ef9ddee5c121d8eaf2f0c2b Mon Sep 17 00:00:00 2001 From: Jason Humphrey Date: Thu, 1 Dec 2016 10:22:34 -0600 Subject: test: use ES6 to update let & const Also updating assertStrict and moving the assert required. PR-URL: https://github.com/nodejs/node/pull/9917 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Franziska Hinkelmann --- test/parallel/test-child-process-stdout-flush-exit.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/parallel/test-child-process-stdout-flush-exit.js') diff --git a/test/parallel/test-child-process-stdout-flush-exit.js b/test/parallel/test-child-process-stdout-flush-exit.js index b76a7cb5e5..9db74b51ce 100644 --- a/test/parallel/test-child-process-stdout-flush-exit.js +++ b/test/parallel/test-child-process-stdout-flush-exit.js @@ -1,23 +1,23 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); // if child process output to console and exit if (process.argv[2] === 'child') { console.log('hello'); - for (var i = 0; i < 200; i++) { + for (let i = 0; i < 200; i++) { console.log('filler'); } console.log('goodbye'); process.exit(0); } else { // parent process - var spawn = require('child_process').spawn; + const spawn = require('child_process').spawn; // spawn self as child - var child = spawn(process.argv[0], [process.argv[1], 'child']); + const child = spawn(process.argv[0], [process.argv[1], 'child']); - var stdout = ''; + let stdout = ''; child.stderr.setEncoding('utf8'); child.stderr.on('data', function(data) { @@ -32,7 +32,7 @@ if (process.argv[2] === 'child') { }); child.on('close', common.mustCall(function() { - assert.equal(stdout.slice(0, 6), 'hello\n'); - assert.equal(stdout.slice(stdout.length - 8), 'goodbye\n'); + assert.strictEqual(stdout.slice(0, 6), 'hello\n'); + assert.strictEqual(stdout.slice(stdout.length - 8), 'goodbye\n'); })); } -- cgit v1.2.3