chore: update PR as per feedback

This commit is contained in:
Samuel Attard 2019-03-14 17:22:42 -07:00
parent 6b326f7924
commit 4b6b59cc82
No known key found for this signature in database
GPG key ID: 191FEF027779CC6C
2 changed files with 10 additions and 10 deletions

View file

@ -8,7 +8,7 @@ const path = require('path')
const unknownArgs = [] const unknownArgs = []
const args = require('minimist')(process.argv, { const args = require('minimist')(process.argv, {
string: ['only'], string: ['runners'],
unknown: arg => unknownArgs.push(arg) unknown: arg => unknownArgs.push(arg)
}) })
@ -19,10 +19,10 @@ const NPM_CMD = process.platform === 'win32' ? 'npm.cmd' : 'npm'
const specHashPath = path.resolve(__dirname, '../spec/.hash') const specHashPath = path.resolve(__dirname, '../spec/.hash')
let only = null let runnersToRun = null
if (args.only) { if (args.runners) {
only = args.only.split(',') runnersToRun = args.only.split(',')
console.log('Only running:', only) console.log('Only running:', runnersToRun)
} else { } else {
console.log('Will trigger all spec runners') console.log('Will trigger all spec runners')
} }
@ -75,7 +75,7 @@ async function runElectronTests () {
const mochaFile = process.env.MOCHA_FILE const mochaFile = process.env.MOCHA_FILE
for (const runner of runners) { for (const runner of runners) {
if (only && !only.includes(runner[1])) { if (runnersToRun && !runnersToRun.includes(runner[1])) {
console.info('\nSkipping:', runner[0]) console.info('\nSkipping:', runner[0])
continue continue
} }

View file

@ -119,7 +119,7 @@ describe('app module', () => {
describe('app.isPackaged', () => { describe('app.isPackaged', () => {
it('should be false durings tests', () => { it('should be false durings tests', () => {
expect(app.isPackaged).equal(false) expect(app.isPackaged).to.equal(false)
}) })
}) })
@ -180,7 +180,7 @@ describe('app module', () => {
// Singleton will send us greeting data to let us know it's running. // Singleton will send us greeting data to let us know it's running.
// After that, ask it to exit gracefully and confirm that it does. // After that, ask it to exit gracefully and confirm that it does.
appProcess.stdout.on('data', data => appProcess && appProcess.kill()) appProcess.stdout.on('data', data => appProcess!.kill())
const [code, signal] = await emittedOnce(appProcess, 'close') const [code, signal] = await emittedOnce(appProcess, 'close')
const message = `code:\n${code}\nsignal:\n${signal}` const message = `code:\n${code}\nsignal:\n${signal}`
@ -1226,9 +1226,9 @@ describe('app module', () => {
expect(app.whenReady()).to.be.a('promise') expect(app.whenReady()).to.be.a('promise')
}) })
it('becomes fulfilled if the app is already ready', () => { it('becomes fulfilled if the app is already ready', async () => {
expect(app.isReady()).to.equal(true) expect(app.isReady()).to.equal(true)
expect(app.whenReady()).to.be.eventually.fulfilled.equal(undefined) await expect(app.whenReady()).to.be.eventually.fulfilled.equal(undefined)
}) })
}) })