ci: Refactor mksnapshot test so that it doesn't stall. (#16875)

This commit is contained in:
John Kleinschmidt 2019-02-11 12:21:00 -10:00 committed by GitHub
parent 7baa218ca9
commit 6a47089c78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 7 deletions

View file

@ -2,19 +2,25 @@
const { app } = require('electron')
app.once('ready', () => {
app.on('ready', () => {
let returnCode = 0
try {
const testValue = f() // eslint-disable-line no-undef
if (testValue === 86) {
console.log('ok test snapshot successfully loaded.')
app.exit(0)
} else {
console.log('not ok test snapshot could not be successfully loaded.')
app.exit(1)
returnCode = 1
}
return
} catch (ex) {
console.log('Error running custom snapshot', ex)
app.exit(1)
returnCode = 1
}
setImmediate(function () {
app.exit(returnCode)
})
})
process.on('exit', function (code) {
console.log('test snapshot exited with code: ' + code)
})

View file

@ -0,0 +1,4 @@
{
"name": "snapshot-items-available",
"main": "main.js"
}