diff --git a/spec/static/index.html b/spec/static/index.html
index e31fcffebb89..6a3e4417c901 100644
--- a/spec/static/index.html
+++ b/spec/static/index.html
@@ -50,6 +50,18 @@
var Mocha = require('mocha');
var mocha = new Mocha();
+
+ if (isCi) {
+ mocha.grep = function () {
+ try {
+ throw new Error('it.only or describe.only was called')
+ } 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 || '');