0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-pipe-head.js
Nicolas Chaulet 2016ad3035 test: use of fixtures in test-pipe-head
Replace usage of common.fixturesDir by using common.fixtures
module in test/parallel/test-pipe-head

PR-URL: https://github.com/nodejs/node/pull/15868
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-10-12 06:35:36 -07:00

18 lines
478 B
JavaScript

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