From c0c1deae4b73bcdc00b7c055b991fe31e163b8a9 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 17:52:55 +0200 Subject: [PATCH 01/19] add fixtures that result in it.only combined with --forbid-only bug --- .../options/forbid-only/only-before-each.fixture.js | 8 ++++++++ .../fixtures/options/forbid-only/only-before.fixture.js | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/integration/fixtures/options/forbid-only/only-before-each.fixture.js create mode 100644 test/integration/fixtures/options/forbid-only/only-before.fixture.js diff --git a/test/integration/fixtures/options/forbid-only/only-before-each.fixture.js b/test/integration/fixtures/options/forbid-only/only-before-each.fixture.js new file mode 100644 index 0000000000..19bfb86409 --- /dev/null +++ b/test/integration/fixtures/options/forbid-only/only-before-each.fixture.js @@ -0,0 +1,8 @@ +'use strict'; + +describe('test marked with only and beforeEach has skip', function() { + beforeEach(function() { + this.skip(); + }); + it.only('only test', function() {}); +}); diff --git a/test/integration/fixtures/options/forbid-only/only-before.fixture.js b/test/integration/fixtures/options/forbid-only/only-before.fixture.js new file mode 100644 index 0000000000..3924ac4082 --- /dev/null +++ b/test/integration/fixtures/options/forbid-only/only-before.fixture.js @@ -0,0 +1,8 @@ +'use strict'; + +describe('test marked with only and before has skip', function() { + before(function() { + this.skip(); + }); + it.only('only test', function() {}); +}); From 63d6144ea6ca5c648ed87592d0b62e59ec5a0fc1 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 17:53:43 +0200 Subject: [PATCH 02/19] adapt forbidonly test cases to cover it.only bug --- test/integration/options/forbidOnly.spec.js | 65 ++++++++++++++++++--- 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/test/integration/options/forbidOnly.spec.js b/test/integration/options/forbidOnly.spec.js index 592f0f25df..9cb7cd8fd2 100644 --- a/test/integration/options/forbidOnly.spec.js +++ b/test/integration/options/forbidOnly.spec.js @@ -24,15 +24,24 @@ describe('--forbid-only', function() { }); }); - it('should fail if there are tests marked only', function(done) { + it('should fail even if beforeEach has "skip"', function(done) { var fixture = path.join('options', 'forbid-only', 'only'); - runMochaJSON(fixture, args, function(err, res) { - if (err) { - return done(err); - } - expect(res, 'to have failed with error', onlyErrorMessage); - done(); - }); + var spawnOpts = {stdio: 'pipe'}; + runMocha( + fixture, + args, + function(err, res) { + if (err) { + return done(err); + } + expect(res, 'to satisfy', { + code: 1, + output: new RegExp(onlyErrorMessage) + }); + done(); + }, + spawnOpts + ); }); it('should fail if there are tests in suites marked only', function(done) { @@ -124,4 +133,44 @@ describe('--forbid-only', function() { } ); }); + + it('should fail even if before has "skip"', function(done) { + var fixture = path.join('options', 'forbid-only', 'only-before'); + var spawnOpts = {stdio: 'pipe'}; + runMocha( + fixture, + args, + function(err, res) { + if (err) { + return done(err); + } + expect(res, 'to satisfy', { + code: 1, + output: new RegExp(onlyErrorMessage) + }); + done(); + }, + spawnOpts + ); + }); + + it('should fail even if beforeEach has "skip"', function(done) { + var fixture = path.join('options', 'forbid-only', 'only-before-each'); + var spawnOpts = {stdio: 'pipe'}; + runMocha( + fixture, + args, + function(err, res) { + if (err) { + return done(err); + } + expect(res, 'to satisfy', { + code: 1, + output: new RegExp(onlyErrorMessage) + }); + done(); + }, + spawnOpts + ); + }); }); From 2f0f1342c3be35e752fc4c2cf5e7872c8d692174 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 17:54:57 +0200 Subject: [PATCH 03/19] check if forbid only option is set prior to marking a test only and throw error --- lib/interfaces/common.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/interfaces/common.js b/lib/interfaces/common.js index 7991e113f7..7e1a3d4298 100644 --- a/lib/interfaces/common.js +++ b/lib/interfaces/common.js @@ -165,6 +165,7 @@ module.exports = function(suites, context, mocha) { * @returns {*} */ only: function(mocha, test) { + if (mocha.options.forbidOnly) throw new Error('`.only` forbidden'); test.markOnly(); return test; }, From 3c8af1b9f35dfb89487addaef0982d8c824849fc Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 18:10:00 +0200 Subject: [PATCH 04/19] change name of only test back to previous --- test/integration/options/forbidOnly.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/options/forbidOnly.spec.js b/test/integration/options/forbidOnly.spec.js index 9cb7cd8fd2..9ca7868d6e 100644 --- a/test/integration/options/forbidOnly.spec.js +++ b/test/integration/options/forbidOnly.spec.js @@ -24,7 +24,7 @@ describe('--forbid-only', function() { }); }); - it('should fail even if beforeEach has "skip"', function(done) { + it('should fail if there are tests marked only', function(done) { var fixture = path.join('options', 'forbid-only', 'only'); var spawnOpts = {stdio: 'pipe'}; runMocha( From 7d6110a1013bb7b1b5e5523ff6c9fb5d1dcee3ad Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 18:58:26 +0200 Subject: [PATCH 05/19] use custom assertion for expecting error in forbidOnly tests --- test/integration/options/forbidOnly.spec.js | 30 +++++---------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/test/integration/options/forbidOnly.spec.js b/test/integration/options/forbidOnly.spec.js index 9ca7868d6e..47ea4081d7 100644 --- a/test/integration/options/forbidOnly.spec.js +++ b/test/integration/options/forbidOnly.spec.js @@ -34,10 +34,7 @@ describe('--forbid-only', function() { if (err) { return done(err); } - expect(res, 'to satisfy', { - code: 1, - output: new RegExp(onlyErrorMessage) - }); + expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); done(); }, spawnOpts @@ -55,10 +52,7 @@ describe('--forbid-only', function() { return done(err); } - expect(res, 'to satisfy', { - code: 1, - output: new RegExp(onlyErrorMessage) - }); + expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); done(); }, spawnOpts @@ -75,10 +69,7 @@ describe('--forbid-only', function() { if (err) { return done(err); } - expect(res, 'to satisfy', { - code: 1, - output: new RegExp(onlyErrorMessage) - }); + expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); done(); }, spawnOpts @@ -95,10 +86,7 @@ describe('--forbid-only', function() { if (err) { return done(err); } - expect(res, 'to satisfy', { - code: 1, - output: new RegExp(onlyErrorMessage) - }); + expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); done(); }, spawnOpts @@ -144,10 +132,7 @@ describe('--forbid-only', function() { if (err) { return done(err); } - expect(res, 'to satisfy', { - code: 1, - output: new RegExp(onlyErrorMessage) - }); + expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); done(); }, spawnOpts @@ -164,10 +149,7 @@ describe('--forbid-only', function() { if (err) { return done(err); } - expect(res, 'to satisfy', { - code: 1, - output: new RegExp(onlyErrorMessage) - }); + expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); done(); }, spawnOpts From 39e89fef228afe6e90b1c2f3e920adf11142c544 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 18:59:24 +0200 Subject: [PATCH 06/19] remove empty line --- test/integration/options/forbidOnly.spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/options/forbidOnly.spec.js b/test/integration/options/forbidOnly.spec.js index 47ea4081d7..1886becb7d 100644 --- a/test/integration/options/forbidOnly.spec.js +++ b/test/integration/options/forbidOnly.spec.js @@ -51,7 +51,6 @@ describe('--forbid-only', function() { if (err) { return done(err); } - expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); done(); }, From 11d5fe1c00bb7c23ff808fc19fd2a2c37977729e Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 19:08:24 +0200 Subject: [PATCH 07/19] use createUnsupportedError instead of throw new Error --- lib/interfaces/common.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/interfaces/common.js b/lib/interfaces/common.js index 7e1a3d4298..e7e84b2511 100644 --- a/lib/interfaces/common.js +++ b/lib/interfaces/common.js @@ -3,6 +3,7 @@ var Suite = require('../suite'); var errors = require('../errors'); var createMissingArgumentError = errors.createMissingArgumentError; +var createUnsupportedError = errors.createUnsupportedError; /** * Functions common to more than one interface. @@ -126,14 +127,14 @@ module.exports = function(suites, context, mocha) { suites.unshift(suite); if (opts.isOnly) { if (mocha.options.forbidOnly && shouldBeTested(suite)) { - throw new Error('`.only` forbidden'); + throw createUnsupportedError('`.only` forbidden'); } suite.parent.appendOnlySuite(suite); } if (suite.pending) { if (mocha.options.forbidPending && shouldBeTested(suite)) { - throw new Error('Pending test forbidden'); + throw createUnsupportedError('Pending test forbidden'); } } if (typeof opts.fn === 'function') { @@ -165,7 +166,8 @@ module.exports = function(suites, context, mocha) { * @returns {*} */ only: function(mocha, test) { - if (mocha.options.forbidOnly) throw new Error('`.only` forbidden'); + if (mocha.options.forbidOnly) + throw createUnsupportedError('`.only` forbidden'); test.markOnly(); return test; }, From 70150489f630748e4c059af566889dc1ca53a218 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 19:08:38 +0200 Subject: [PATCH 08/19] use createUnsupportedError instead of throw new Error --- lib/runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runner.js b/lib/runner.js index aabffda96a..3131c67b0d 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -524,7 +524,7 @@ Runner.prototype.runTest = function(fn) { var suite = this.parents().reverse()[0] || this.suite; if (this.forbidOnly && suite.hasOnly()) { - fn(new Error('`.only` forbidden')); + fn(createUnsupportedError('`.only` forbidden')); return; } if (this.asyncOnly) { From 956cef290736cfa3efee8e71c440850255e69756 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 28 Apr 2020 19:25:03 +0200 Subject: [PATCH 09/19] remove check if suite hasOnly and forbidOnly option is set as this is done before runtime --- lib/runner.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/runner.js b/lib/runner.js index 3131c67b0d..c2bdf28bc8 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -522,11 +522,6 @@ Runner.prototype.runTest = function(fn) { return; } - var suite = this.parents().reverse()[0] || this.suite; - if (this.forbidOnly && suite.hasOnly()) { - fn(createUnsupportedError('`.only` forbidden')); - return; - } if (this.asyncOnly) { test.asyncOnly = true; } From 4b37e3c1f6ecee6a90ef8c12dc8e3e7baabe98b1 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 5 May 2020 23:42:27 +0200 Subject: [PATCH 10/19] implement markOnly instance method in suite class --- lib/suite.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/suite.js b/lib/suite.js index 191d946b50..b693ce10c4 100644 --- a/lib/suite.js +++ b/lib/suite.js @@ -493,6 +493,16 @@ Suite.prototype.appendOnlySuite = function(suite) { this._onlySuites.push(suite); }; +/** + * Marks a suite to be `only`. + * + * @private + * @param {Suite} suite + */ +Suite.prototype.markOnly = function() { + this.parent.appendOnlySuite(this); +}; + /** * Adds a test to the list of tests marked `only`. * From c2c8dc8b2fc2fdaf73c2edaf5afee78edbf15576 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 5 May 2020 23:43:00 +0200 Subject: [PATCH 11/19] add unit test for suites markOnly method --- test/unit/suite.spec.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/unit/suite.spec.js b/test/unit/suite.spec.js index 1be948e1c6..9a55c05c26 100644 --- a/test/unit/suite.spec.js +++ b/test/unit/suite.spec.js @@ -638,6 +638,31 @@ describe('Suite', function() { }); }); }); + + describe('.markOnly()', function() { + var sandbox; + + beforeEach(function() { + sandbox = sinon.createSandbox(); + }); + + afterEach(function() { + sandbox.restore(); + }); + + it('should call appendOnlySuite on parent', function() { + var suite = new Suite('a'); + var spy = sandbox.spy(); + suite.parent = { + appendOnlySuite: spy + }; + suite.markOnly(); + + expect(spy, 'to have a call exhaustively satisfying', [suite]).and( + 'was called once' + ); + }); + }); }); describe('Test', function() { From f87178241fc74a54739497a5f1faedbf1cab5e76 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 5 May 2020 23:44:23 +0200 Subject: [PATCH 12/19] throw exception if --forbid-only option is set even if suite is not selected by grep --- lib/interfaces/common.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/interfaces/common.js b/lib/interfaces/common.js index e7e84b2511..53c8d8c26c 100644 --- a/lib/interfaces/common.js +++ b/lib/interfaces/common.js @@ -93,6 +93,9 @@ module.exports = function(suites, context, mocha) { * @returns {Suite} */ only: function only(opts) { + if (mocha.options.forbidOnly) { + throw createUnsupportedError('`.only` forbidden'); + } opts.isOnly = true; return this.create(opts); }, @@ -126,11 +129,7 @@ module.exports = function(suites, context, mocha) { suite.file = opts.file; suites.unshift(suite); if (opts.isOnly) { - if (mocha.options.forbidOnly && shouldBeTested(suite)) { - throw createUnsupportedError('`.only` forbidden'); - } - - suite.parent.appendOnlySuite(suite); + suite.markOnly(); } if (suite.pending) { if (mocha.options.forbidPending && shouldBeTested(suite)) { From 336425ad89d9fbc7b728040ae02c9ec013cf727e Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 5 May 2020 23:45:43 +0200 Subject: [PATCH 13/19] adapt forbidOnly integration tests to check for failure if only suite is not selected by grep --- test/integration/options/forbidOnly.spec.js | 35 ++++++++++++--------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/test/integration/options/forbidOnly.spec.js b/test/integration/options/forbidOnly.spec.js index 1886becb7d..252c5b99b9 100644 --- a/test/integration/options/forbidOnly.spec.js +++ b/test/integration/options/forbidOnly.spec.js @@ -92,32 +92,37 @@ describe('--forbid-only', function() { ); }); - it('should succeed if suite marked only does not match grep', function(done) { + it('should fail if suite marked only does not match grep', function(done) { var fixture = path.join('options', 'forbid-only', 'only-suite'); - runMochaJSON(fixture, args.concat('--fgrep', 'bumble bees'), function( - err, - res - ) { - if (err) { - return done(err); - } - expect(res, 'to have passed'); - done(); - }); + var spawnOpts = {stdio: 'pipe'}; + runMocha( + fixture, + args.concat('--fgrep', 'bumble bees'), + function(err, res) { + if (err) { + return done(err); + } + expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); + done(); + }, + spawnOpts + ); }); - it('should succeed if suite marked only does not match inverted grep', function(done) { + it('should fail if suite marked only does not match inverted grep', function(done) { var fixture = path.join('options', 'forbid-only', 'only-suite'); - runMochaJSON( + var spawnOpts = {stdio: 'pipe'}; + runMocha( fixture, args.concat('--fgrep', 'suite marked with only', '--invert'), function(err, res) { if (err) { return done(err); } - expect(res, 'to have passed'); + expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); done(); - } + }, + spawnOpts ); }); From cffc71a5c55114805a05a08c131439b993cf7d1c Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Thu, 7 May 2020 12:30:03 +0200 Subject: [PATCH 14/19] fix jsdocs of suite markonly --- lib/suite.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/suite.js b/lib/suite.js index b693ce10c4..c56ebcfeec 100644 --- a/lib/suite.js +++ b/lib/suite.js @@ -497,7 +497,6 @@ Suite.prototype.appendOnlySuite = function(suite) { * Marks a suite to be `only`. * * @private - * @param {Suite} suite */ Suite.prototype.markOnly = function() { this.parent.appendOnlySuite(this); From 419f584afe70afca597c41657e8ab504701278e6 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 12 May 2020 08:12:48 +0200 Subject: [PATCH 15/19] Revert "fix jsdocs of suite markonly" This reverts commit cffc71a5c55114805a05a08c131439b993cf7d1c. --- lib/suite.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/suite.js b/lib/suite.js index c56ebcfeec..b693ce10c4 100644 --- a/lib/suite.js +++ b/lib/suite.js @@ -497,6 +497,7 @@ Suite.prototype.appendOnlySuite = function(suite) { * Marks a suite to be `only`. * * @private + * @param {Suite} suite */ Suite.prototype.markOnly = function() { this.parent.appendOnlySuite(this); From 189b5cf25302268580e64a0f3d42248d63e2852b Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 12 May 2020 08:13:27 +0200 Subject: [PATCH 16/19] Revert "adapt forbidOnly integration tests to check for failure if only suite is not selected by grep" This reverts commit 336425ad89d9fbc7b728040ae02c9ec013cf727e. --- test/integration/options/forbidOnly.spec.js | 35 +++++++++------------ 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/test/integration/options/forbidOnly.spec.js b/test/integration/options/forbidOnly.spec.js index 252c5b99b9..1886becb7d 100644 --- a/test/integration/options/forbidOnly.spec.js +++ b/test/integration/options/forbidOnly.spec.js @@ -92,37 +92,32 @@ describe('--forbid-only', function() { ); }); - it('should fail if suite marked only does not match grep', function(done) { + it('should succeed if suite marked only does not match grep', function(done) { var fixture = path.join('options', 'forbid-only', 'only-suite'); - var spawnOpts = {stdio: 'pipe'}; - runMocha( - fixture, - args.concat('--fgrep', 'bumble bees'), - function(err, res) { - if (err) { - return done(err); - } - expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); - done(); - }, - spawnOpts - ); + runMochaJSON(fixture, args.concat('--fgrep', 'bumble bees'), function( + err, + res + ) { + if (err) { + return done(err); + } + expect(res, 'to have passed'); + done(); + }); }); - it('should fail if suite marked only does not match inverted grep', function(done) { + it('should succeed if suite marked only does not match inverted grep', function(done) { var fixture = path.join('options', 'forbid-only', 'only-suite'); - var spawnOpts = {stdio: 'pipe'}; - runMocha( + runMochaJSON( fixture, args.concat('--fgrep', 'suite marked with only', '--invert'), function(err, res) { if (err) { return done(err); } - expect(res, 'to have failed with output', new RegExp(onlyErrorMessage)); + expect(res, 'to have passed'); done(); - }, - spawnOpts + } ); }); From 053867f4f955b600630cb1a03b31bfe3bc0ab582 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 12 May 2020 08:13:44 +0200 Subject: [PATCH 17/19] Revert "throw exception if --forbid-only option is set even if suite is not selected by grep" This reverts commit f87178241fc74a54739497a5f1faedbf1cab5e76. --- lib/interfaces/common.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/interfaces/common.js b/lib/interfaces/common.js index 53c8d8c26c..e7e84b2511 100644 --- a/lib/interfaces/common.js +++ b/lib/interfaces/common.js @@ -93,9 +93,6 @@ module.exports = function(suites, context, mocha) { * @returns {Suite} */ only: function only(opts) { - if (mocha.options.forbidOnly) { - throw createUnsupportedError('`.only` forbidden'); - } opts.isOnly = true; return this.create(opts); }, @@ -129,7 +126,11 @@ module.exports = function(suites, context, mocha) { suite.file = opts.file; suites.unshift(suite); if (opts.isOnly) { - suite.markOnly(); + if (mocha.options.forbidOnly && shouldBeTested(suite)) { + throw createUnsupportedError('`.only` forbidden'); + } + + suite.parent.appendOnlySuite(suite); } if (suite.pending) { if (mocha.options.forbidPending && shouldBeTested(suite)) { From 08341995407bd674c805116fed3f08404545aacc Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 12 May 2020 08:15:03 +0200 Subject: [PATCH 18/19] Revert "add unit test for suites markOnly method" This reverts commit c2c8dc8b2fc2fdaf73c2edaf5afee78edbf15576. --- test/unit/suite.spec.js | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/test/unit/suite.spec.js b/test/unit/suite.spec.js index 9a55c05c26..1be948e1c6 100644 --- a/test/unit/suite.spec.js +++ b/test/unit/suite.spec.js @@ -638,31 +638,6 @@ describe('Suite', function() { }); }); }); - - describe('.markOnly()', function() { - var sandbox; - - beforeEach(function() { - sandbox = sinon.createSandbox(); - }); - - afterEach(function() { - sandbox.restore(); - }); - - it('should call appendOnlySuite on parent', function() { - var suite = new Suite('a'); - var spy = sandbox.spy(); - suite.parent = { - appendOnlySuite: spy - }; - suite.markOnly(); - - expect(spy, 'to have a call exhaustively satisfying', [suite]).and( - 'was called once' - ); - }); - }); }); describe('Test', function() { From 3d21897202c5ecd7374312279fa8ff6f6f848ee3 Mon Sep 17 00:00:00 2001 From: Arvid Ottenberg Date: Tue, 12 May 2020 08:15:23 +0200 Subject: [PATCH 19/19] Revert "implement markOnly instance method in suite class" This reverts commit 4b37e3c1f6ecee6a90ef8c12dc8e3e7baabe98b1. --- lib/suite.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/suite.js b/lib/suite.js index b693ce10c4..191d946b50 100644 --- a/lib/suite.js +++ b/lib/suite.js @@ -493,16 +493,6 @@ Suite.prototype.appendOnlySuite = function(suite) { this._onlySuites.push(suite); }; -/** - * Marks a suite to be `only`. - * - * @private - * @param {Suite} suite - */ -Suite.prototype.markOnly = function() { - this.parent.appendOnlySuite(this); -}; - /** * Adds a test to the list of tests marked `only`. *