Skip to content

Commit 274eef4

Browse files
furnoxevanlucas
authored andcommitted
test: refactoring test-pipe-head
- 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]>
1 parent 7c406e8 commit 274eef4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/parallel/test-pipe-head.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

5-
var exec = require('child_process').exec;
6-
var join = require('path').join;
5+
const exec = require('child_process').exec;
6+
const join = require('path').join;
77

8-
var nodePath = process.argv[0];
9-
var script = join(common.fixturesDir, 'print-10-lines.js');
8+
const nodePath = process.argv[0];
9+
const script = join(common.fixturesDir, 'print-10-lines.js');
1010

11-
var cmd = '"' + nodePath + '" "' + script + '" | head -2';
11+
const cmd = `"${nodePath}" "${script}" | head -2`;
1212

1313
exec(cmd, common.mustCall(function(err, stdout, stderr) {
14-
if (err) throw err;
15-
var lines = stdout.split('\n');
16-
assert.equal(3, lines.length);
14+
assert.ifError(err);
15+
const lines = stdout.split('\n');
16+
assert.strictEqual(3, lines.length);
1717
}));

0 commit comments

Comments
 (0)