From 4e6fc8d0ca167190869973ec253a65b3b525f96d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 26 Dec 2021 12:31:15 -0800 Subject: [PATCH] test: use spawnSync() full name in test-stdio-pipe-stderr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-stdio-pipe-stderr uses `spawnSync()` but renames it as `spawn()` which can be confusing. Rename it to `spawnSync()` for readability/maintainability. PR-URL: https://github.com/nodejs/node/pull/41332 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Darshan Sen Reviewed-By: Luigi Pinca --- test/parallel/test-stdio-pipe-stderr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-stdio-pipe-stderr.js b/test/parallel/test-stdio-pipe-stderr.js index 9dc5c758cf6c50..9ec41b4159fdf6 100644 --- a/test/parallel/test-stdio-pipe-stderr.js +++ b/test/parallel/test-stdio-pipe-stderr.js @@ -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, @@ -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] });