mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 07:51:12 +00:00

PR-URL: https://github.com/nodejs/node/pull/35086 Reviewed-By: Ruy Adorno <ruyadorno@github.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
17 lines
448 B
JavaScript
17 lines
448 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.mustSucceed((stdout, stderr) => {
|
|
const lines = stdout.split('\n');
|
|
assert.strictEqual(lines.length, 3);
|
|
}));
|