From 0e8d87930533713dc77a9a5bfd90fbd5f0d04a3d Mon Sep 17 00:00:00 2001 From: David Neubauer Date: Sun, 16 Oct 2016 16:59:16 +0200 Subject: [PATCH] Fix .only() behaviour when running with watch option --- lib/runner.js | 2 +- mocha.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/runner.js b/lib/runner.js index 697ffb65ac..4553516dc3 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -795,7 +795,7 @@ Runner.prototype.run = function (fn) { var rootSuite = this.suite; // If there is an `only` filter - if (this.hasOnly) { + if (hasOnly(rootSuite)) { filterOnly(rootSuite); } diff --git a/mocha.js b/mocha.js index 16d5619e27..472bb1e788 100644 --- a/mocha.js +++ b/mocha.js @@ -5285,7 +5285,7 @@ Runner.prototype.run = function (fn) { var rootSuite = this.suite; // If there is an `only` filter - if (this.hasOnly) { + if (hasOnly(rootSuite)) { filterOnly(rootSuite); }