Skip to content

Commit

Permalink
test: use spawnSync() full name in test-stdio-pipe-stderr
Browse files Browse the repository at this point in the history
test-stdio-pipe-stderr uses `spawnSync()` but renames it as `spawn()`
which can be confusing. Rename it to `spawnSync()` for
readability/maintainability.

PR-URL: nodejs#41332
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Trott authored and Linkgoron committed Jan 31, 2022
1 parent 129108a commit 93b323a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-stdio-pipe-stderr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const tmpdir = require('../common/tmpdir');
const assert = require('assert');
const fs = require('fs');
const join = require('path').join;
const spawn = require('child_process').spawnSync;
const { spawnSync } = require('child_process');

// Test that invoking node with require, and piping stderr to file,
// does not result in exception,
Expand All @@ -21,7 +21,7 @@ const stream = fs.createWriteStream(stderrOutputPath);
fs.writeFileSync(fakeModulePath, '', 'utf8');

stream.on('open', () => {
spawn(process.execPath, {
spawnSync(process.execPath, {
input: `require("${fakeModulePath.replace(/\\/g, '/')}")`,
stdio: ['pipe', 'pipe', stream]
});
Expand Down

0 comments on commit 93b323a

Please sign in to comment.