diff --git a/lib/runner.js b/lib/runner.js index 039065a2e0..b6e6e1f24a 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -794,7 +794,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 2ad1356722..57fcf07ab6 100644 --- a/mocha.js +++ b/mocha.js @@ -5319,7 +5319,7 @@ Runner.prototype.run = function (fn) { var rootSuite = this.suite; // If there is an `only` filter - if (this.hasOnly) { + if (hasOnly(rootSuite)) { filterOnly(rootSuite); }