Check runner.hasOnly for focused spec check

This commit is contained in:
Kevin Sawicki 2016-11-22 13:06:18 -08:00
parent 6c046704c7
commit 89965aa5db

View file

@ -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({