test: add test for second-instance event parameter (#16798)

* test: add test for second-instance event parameter

* robustify getting data from child process

* fix test on windows

* fix lint

* Update api-app-spec.js

* fix package-lock.json
This commit is contained in:
Jeremy Apthorp 2019-03-12 08:56:28 -07:00 committed by John Kleinschmidt
parent 48a95f9677
commit ea6a926494
3 changed files with 34 additions and 2 deletions

View file

@ -6,8 +6,11 @@ app.once('ready', () => {
const gotTheLock = app.requestSingleInstanceLock()
app.on('second-instance', () => {
setImmediate(() => app.exit(0))
app.on('second-instance', (event, args) => {
setImmediate(() => {
console.log(JSON.stringify(args))
app.exit(0)
})
})
if (!gotTheLock) {