mirror of
https://github.com/electron/electron.git
synced 2026-01-25 23:38:18 -05:00
Merge pull request #8056 from electron/mocha-only-check
Check runner.hasOnly for focused spec check
This commit is contained in:
@@ -54,17 +54,6 @@
|
||||
|
||||
var mocha = new Mocha();
|
||||
|
||||
if (isCi) {
|
||||
mocha.grep = function () {
|
||||
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)
|
||||
}
|
||||
ipcRenderer.send('process.exit', 1)
|
||||
}
|
||||
}
|
||||
|
||||
mocha.ui('bdd').reporter(isCi ? 'tap' : 'html');
|
||||
|
||||
var query = Mocha.utils.parseQuery(window.location.search || '');
|
||||
@@ -83,6 +72,16 @@
|
||||
|
||||
walker.on('end', function() {
|
||||
var runner = mocha.run(function() {
|
||||
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)
|
||||
}
|
||||
ipcRenderer.send('process.exit', 1)
|
||||
return
|
||||
}
|
||||
|
||||
Mocha.utils.highlightTags('code');
|
||||
|
||||
var coverage = new Coverage({
|
||||
|
||||
Reference in New Issue
Block a user