ci: Refactor mksnapshot test so that it doesn't stall. (#16875)
This commit is contained in:
parent
7baa218ca9
commit
6a47089c78
4 changed files with 20 additions and 7 deletions
|
@ -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)
|
||||
})
|
4
spec/fixtures/snapshot-items-available/package.json
vendored
Normal file
4
spec/fixtures/snapshot-items-available/package.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "snapshot-items-available",
|
||||
"main": "main.js"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue