Browse Source

test: refactoring test-pipe-head

- Updated assert.equal to assert.strictEqual
- Updated 'var' to 'const'
- Using template literals

PR-URL: https://github.com/nodejs/node/pull/10036
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
v6
Travis Bretton 8 years ago
committed by Italo A. Casas
parent
commit
7c9dc5d9bc
  1. 20
      test/parallel/test-pipe-head.js

20
test/parallel/test-pipe-head.js

@ -1,17 +1,17 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var exec = require('child_process').exec; const exec = require('child_process').exec;
var join = require('path').join; const join = require('path').join;
var nodePath = process.argv[0]; const nodePath = process.argv[0];
var script = join(common.fixturesDir, 'print-10-lines.js'); const script = join(common.fixturesDir, 'print-10-lines.js');
var cmd = '"' + nodePath + '" "' + script + '" | head -2'; const cmd = `"${nodePath}" "${script}" | head -2`;
exec(cmd, common.mustCall(function(err, stdout, stderr) { exec(cmd, common.mustCall(function(err, stdout, stderr) {
if (err) throw err; assert.ifError(err);
var lines = stdout.split('\n'); const lines = stdout.split('\n');
assert.equal(3, lines.length); assert.strictEqual(3, lines.length);
})); }));

Loading…
Cancel
Save