Skip to content

Commit

Permalink
Remove hall occurrences of the hasOnly property
Browse files Browse the repository at this point in the history
  • Loading branch information
ddneat committed Aug 9, 2017
1 parent e723bda commit 048ead3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions lib/interfaces/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ module.exports = function (suites, context, mocha) {
* @returns {Suite}
*/
only: function only (opts) {
mocha.options.hasOnly = true;
opts.isOnly = true;
return this.create(opts);
},
Expand Down Expand Up @@ -108,7 +107,6 @@ module.exports = function (suites, context, mocha) {
suites.unshift(suite);
if (opts.isOnly) {
suite.parent._onlySuites = suite.parent._onlySuites.concat(suite);
mocha.options.hasOnly = true;
}
if (typeof opts.fn === 'function') {
opts.fn.call(suite);
Expand All @@ -132,7 +130,6 @@ module.exports = function (suites, context, mocha) {
*/
only: function (mocha, test) {
test.parent._onlyTests = test.parent._onlyTests.concat(test);
mocha.options.hasOnly = true;
return test;
},

Expand Down
1 change: 0 additions & 1 deletion lib/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ Mocha.prototype.run = function (fn) {
var reporter = new this._reporter(runner, options);
runner.ignoreLeaks = options.ignoreLeaks !== false;
runner.fullStackTrace = options.fullStackTrace;
runner.hasOnly = options.hasOnly;
runner.asyncOnly = options.asyncOnly;
runner.allowUncaught = options.allowUncaught;
runner.forbidOnly = options.forbidOnly;
Expand Down
2 changes: 1 addition & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ Runner.prototype.run = function (fn) {

// callback
this.on('end', function () {
if (self.forbidOnly && self.hasOnly) {
if (self.forbidOnly && hasOnly(rootSuite)) {
self.failures += self.stats.tests;
}
if (self.forbidPending) {
Expand Down

0 comments on commit 048ead3

Please sign in to comment.