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

This commit is contained in:
Samuel Attard 2019-03-14 15:23:21 -07:00
Родитель be60f93bd0
Коммит df57ac4ce7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 191FEF027779CC6C
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -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'
})