From 89965aa5dbcedf7bebb0db28423ad0ffcb3891af Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 22 Nov 2016 13:06:18 -0800 Subject: [PATCH] Check runner.hasOnly for focused spec check --- spec/static/index.html | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/spec/static/index.html b/spec/static/index.html index 49e3f102efbc..336274a71076 100644 --- a/spec/static/index.html +++ b/spec/static/index.html @@ -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({