Skip to content

Commit

Permalink
test: use spawnSync() full name
Browse files Browse the repository at this point in the history
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: #41327
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Trott authored and targos committed Jan 14, 2022
1 parent 5fc886f commit c136d59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-cli-bad-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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);

Expand Down

0 comments on commit c136d59

Please sign in to comment.