You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
478 B

'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);
}));