From e0f2c155215fd5c8a108e5cd51821491b52a5521 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 25 Dec 2021 22:23:26 -0800 Subject: [PATCH] test: use spawnSync() full name 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. --- 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);