mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 22:25:44 +00:00

Make changes so that tests will pass when the comma-dangle settings applied to the rest of the code base are also applied to tests. PR-URL: https://github.com/nodejs/node/pull/37930 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
27 lines
557 B
JavaScript
27 lines
557 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const os = require('os');
|
|
|
|
if (process.argv[2] === 'child') {
|
|
const { pipeline } = require('stream');
|
|
pipeline(
|
|
process.stdin,
|
|
process.stdout,
|
|
common.mustSucceed()
|
|
);
|
|
} else {
|
|
const cp = require('child_process');
|
|
cp.exec([
|
|
'echo',
|
|
'hello',
|
|
'|',
|
|
`"${process.execPath}"`,
|
|
`"${__filename}"`,
|
|
'child',
|
|
].join(' '), common.mustSucceed((stdout) => {
|
|
assert.strictEqual(stdout.split(os.EOL).shift().trim(), 'hello');
|
|
}));
|
|
}
|