Skip to content

Commit c136d59

Browse files
Trotttargos
authored andcommitted
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. PR-URL: #41327 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 5fc886f commit c136d59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-cli-bad-options.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require('../common');
44
// Tests that node exits consistently on bad option syntax.
55

66
const assert = require('assert');
7-
const spawn = require('child_process').spawnSync;
7+
const { spawnSync } = require('child_process');
88

99
if (process.features.inspector) {
1010
requiresArgument('--inspect-port');
@@ -15,7 +15,7 @@ if (process.features.inspector) {
1515
requiresArgument('--eval');
1616

1717
function requiresArgument(option) {
18-
const r = spawn(process.execPath, [option], { encoding: 'utf8' });
18+
const r = spawnSync(process.execPath, [option], { encoding: 'utf8' });
1919

2020
assert.strictEqual(r.status, 9);
2121

0 commit comments

Comments
 (0)