diff options
author | Jason Humphrey <Humphrey.jason32@gmail.com> | 2016-12-01 10:22:34 -0600 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-12-06 13:03:39 -0800 |
commit | a1bd070f87bfb7d32ef9ddee5c121d8eaf2f0c2b (patch) | |
tree | da9a96421fc7b148c8687e8cb3bb271417257314 /test/parallel/test-child-process-stdout-flush-exit.js | |
parent | a3a3937d7611d458f8b955db9941d29df9740abf (diff) | |
download | android-node-v8-a1bd070f87bfb7d32ef9ddee5c121d8eaf2f0c2b.tar.gz android-node-v8-a1bd070f87bfb7d32ef9ddee5c121d8eaf2f0c2b.tar.bz2 android-node-v8-a1bd070f87bfb7d32ef9ddee5c121d8eaf2f0c2b.zip |
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 <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'test/parallel/test-child-process-stdout-flush-exit.js')
-rw-r--r-- | test/parallel/test-child-process-stdout-flush-exit.js | 16 |
1 files changed, 8 insertions, 8 deletions
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'); })); } |