build: fix spec-main linting for 'only' (#17666)
This commit is contained in:
parent
59e3164206
commit
8c8eac88a4
1 changed files with 3 additions and 11 deletions
|
@ -74,20 +74,12 @@ app.whenReady().then(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
walker.on('end', () => {
|
walker.on('end', () => {
|
||||||
const runner = mocha.run(() => {
|
const cb = () => {
|
||||||
// Ensure the callback is called after runner is defined
|
// Ensure the callback is called after runner is defined
|
||||||
process.nextTick(() => {
|
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.')
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error.stack || error)
|
|
||||||
}
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
process.exit(runner.failures)
|
process.exit(runner.failures)
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
const runner = (isCI) ? mocha.run(cb) : mocha.forbidOnly().run(cb)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue