diff --git a/test/helpers/cli.js b/test/helpers/cli.js index 433207f6..9e5f099e 100644 --- a/test/helpers/cli.js +++ b/test/helpers/cli.js @@ -1,7 +1,5 @@ 'use strict' -const { platform } = require('process') - const execa = require('execa') const isCi = require('is-ci') @@ -11,8 +9,7 @@ const BINARY_PATH = `${__dirname}/../../localpack/bin/unix_permissions.js` // exception throwing const testCli = async function({ t, output, error, command, args }) { // We only run this in CI because it's slow. - // Windows somehow freezes in CI. - if (!isCi || platform === 'win32' || !args.some(isValidCliArgument)) { + if (!isCi || !args.some(isValidCliArgument)) { return } @@ -31,10 +28,9 @@ const isValidCliArgument = function(arg) { // Fire CLI command const fireBinary = async function(command, ...args) { - const argsA = args.map(escapeArg).join(' ') - - const { stdout, stderr, code } = await execa.shell( - `${BINARY_PATH} ${command} ${argsA}`, + const { stdout, stderr, code } = await execa( + BINARY_PATH, + [command, ...args], { reject: false }, ) @@ -43,10 +39,6 @@ const fireBinary = async function(command, ...args) { return { stdout: stdoutA, stderr: stderrA, code } } -const escapeArg = function(arg) { - return String(arg).replace(/\s/gu, '\\$&') -} - const normalizeOutput = function({ output, error }) { if (typeof output === 'boolean') { return { output: '', error: !output }