From 8c8eac88a480c067f1d497d90d068958182927e1 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 3 Apr 2019 11:19:39 -0700 Subject: [PATCH] build: fix spec-main linting for 'only' (#17666) --- spec-main/index.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/spec-main/index.js b/spec-main/index.js index b2d14f25d95b..7e744b959b23 100644 --- a/spec-main/index.js +++ b/spec-main/index.js @@ -74,20 +74,12 @@ app.whenReady().then(() => { }) walker.on('end', () => { - const runner = mocha.run(() => { + const cb = () => { // Ensure the callback is called after runner is defined process.nextTick(() => { - 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) - } - process.exit(1) - } - process.exit(runner.failures) }) - }) + } + const runner = (isCI) ? mocha.run(cb) : mocha.forbidOnly().run(cb) }) })