Skip to content

Commit

Permalink
test: refactoring test-pipe-head
Browse files Browse the repository at this point in the history
- Updated assert.equal to assert.strictEqual
- Updated 'var' to 'const'
- Using template literals

PR-URL: #10036
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
  • Loading branch information
furnox authored and MylesBorins committed Feb 1, 2017
1 parent 11115c0 commit 22226fa
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/parallel/test-pipe-head.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
'use strict';
var common = require('../common');
var assert = require('assert');
const common = require('../common');
const assert = require('assert');

var exec = require('child_process').exec;
var join = require('path').join;
const exec = require('child_process').exec;
const join = require('path').join;

var nodePath = process.argv[0];
var script = join(common.fixturesDir, 'print-10-lines.js');
const nodePath = process.argv[0];
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) {
if (err) throw err;
var lines = stdout.split('\n');
assert.equal(3, lines.length);
assert.ifError(err);
const lines = stdout.split('\n');
assert.strictEqual(3, lines.length);
}));

0 comments on commit 22226fa

Please sign in to comment.