build: ensure runner is defined inside the spec callback (#17664)
This commit is contained in:
parent
dc4fe537ee
commit
59e3164206
2 changed files with 26 additions and 20 deletions
|
@ -75,6 +75,8 @@ app.whenReady().then(() => {
|
|||
|
||||
walker.on('end', () => {
|
||||
const runner = mocha.run(() => {
|
||||
// Ensure the callback is called after runner is defined
|
||||
process.nextTick(() => {
|
||||
if (isCi && runner.hasOnly) {
|
||||
try {
|
||||
throw new Error('A spec contains a call to it.only or describe.only and should be reverted.')
|
||||
|
@ -87,4 +89,5 @@ app.whenReady().then(() => {
|
|||
process.exit(runner.failures)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -94,6 +94,8 @@
|
|||
}
|
||||
|
||||
const runner = mocha.run(() => {
|
||||
// Ensure the callback is called after runner is defined
|
||||
setTimeout(() => {
|
||||
if (isCi && runner.hasOnly) {
|
||||
try {
|
||||
throw new Error('A spec contains a call to it.only or describe.only and should be reverted.')
|
||||
|
@ -109,6 +111,7 @@
|
|||
if (isCi) {
|
||||
ipcRenderer.send('process.exit', runner.failures)
|
||||
}
|
||||
}, 0)
|
||||
})
|
||||
})
|
||||
})()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue