From df57ac4ce737a6053500de153f3a16470688d5fc Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 14 Mar 2019 15:23:21 -0700 Subject: [PATCH] chore: steal all unknown args for use by the spec runners --- script/spec-runner.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/script/spec-runner.js b/script/spec-runner.js index d7d9b8cbfcc8..37852521822e 100755 --- a/script/spec-runner.js +++ b/script/spec-runner.js @@ -5,8 +5,11 @@ const crypto = require('crypto') const fs = require('fs') const { hashElement } = require('folder-hash') const path = require('path') +const unknownArgs = [] + const args = require('minimist')(process.argv, { - string: ['only'] + string: ['only'], + unknown: arg => unknownArgs.push(arg) }) const utils = require('./lib/utils') @@ -98,7 +101,7 @@ async function runElectronTests () { async function runRemoteBasedElectronTests () { let exe = path.resolve(BASE, utils.getElectronExec()) - const runnerArgs = ['electron/spec', ...args._.slice(2)] + const runnerArgs = ['electron/spec', unknownArgs.slice(2)] if (process.platform === 'linux') { runnerArgs.unshift(path.resolve(__dirname, 'dbus_mock.py'), exe) exe = 'python' @@ -116,7 +119,7 @@ async function runRemoteBasedElectronTests () { async function runMainProcessElectronTests () { const exe = path.resolve(BASE, utils.getElectronExec()) - const { status } = childProcess.spawnSync(exe, ['electron/spec-main', ...args._.slice(2)], { + const { status } = childProcess.spawnSync(exe, ['electron/spec-main', ...unknownArgs.slice(2)], { cwd: path.resolve(__dirname, '../..'), stdio: 'inherit' })