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);