Browse Source

chore: steal all unknown args for use by the spec runners

Samuel Attard 6 years ago
parent
commit
df57ac4ce7
1 changed files with 6 additions and 3 deletions
  1. 6 3
      script/spec-runner.js

+ 6 - 3
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'
   })