Check runner.hasOnly for focused spec check
This commit is contained in:
parent
6c046704c7
commit
89965aa5db
1 changed files with 10 additions and 11 deletions
|
@ -54,17 +54,6 @@
|
||||||
|
|
||||||
var mocha = new Mocha();
|
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');
|
mocha.ui('bdd').reporter(isCi ? 'tap' : 'html');
|
||||||
|
|
||||||
var query = Mocha.utils.parseQuery(window.location.search || '');
|
var query = Mocha.utils.parseQuery(window.location.search || '');
|
||||||
|
@ -83,6 +72,16 @@
|
||||||
|
|
||||||
walker.on('end', function() {
|
walker.on('end', function() {
|
||||||
var runner = mocha.run(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');
|
Mocha.utils.highlightTags('code');
|
||||||
|
|
||||||
var coverage = new Coverage({
|
var coverage = new Coverage({
|
||||||
|
|
Loading…
Reference in a new issue