From b1e4387c92ed49fb9526926308274120d6a139a3 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 29 Dec 2021 21:58:09 -0800 Subject: [PATCH] test: use spawnSync() full name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-cli-bad-options.js uses `spawnSync()` but renames it as `spawn()` which caused me a bit of confusion for a bit until I realized what was going on. Rename the variable `spawnSync()` for readability/maintainability. PR-URL: https://github.com/nodejs/node/pull/41327 Reviewed-By: Darshan Sen Reviewed-By: Tobias Nießen Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig --- test/parallel/test-cli-bad-options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-cli-bad-options.js b/test/parallel/test-cli-bad-options.js index 3fc8980c142509..1bdaf5ee939b9f 100644 --- a/test/parallel/test-cli-bad-options.js +++ b/test/parallel/test-cli-bad-options.js @@ -4,7 +4,7 @@ require('../common'); // Tests that node exits consistently on bad option syntax. const assert = require('assert'); -const spawn = require('child_process').spawnSync; +const { spawnSync } = require('child_process'); if (process.features.inspector) { requiresArgument('--inspect-port'); @@ -15,7 +15,7 @@ if (process.features.inspector) { requiresArgument('--eval'); function requiresArgument(option) { - const r = spawn(process.execPath, [option], { encoding: 'utf8' }); + const r = spawnSync(process.execPath, [option], { encoding: 'utf8' }); assert.strictEqual(r.status, 9);