diff --git a/lib/interfaces/bdd.js b/lib/interfaces/bdd.js index 33efc169a2..7a54375a94 100644 --- a/lib/interfaces/bdd.js +++ b/lib/interfaces/bdd.js @@ -102,7 +102,7 @@ module.exports = function (suite) { */ context.xit = context.xspecify = context.it.skip = function (title) { - context.it(title); + return context.it(title); }; /** diff --git a/test/interfaces/bdd.spec.js b/test/interfaces/bdd.spec.js index 2289c12497..2b492eb4a0 100644 --- a/test/interfaces/bdd.spec.js +++ b/test/interfaces/bdd.spec.js @@ -40,3 +40,27 @@ describe('pending suite', function () { }); }); }); + +describe('pending tests', function () { + it.skip('should not run', function () { + expect(1 + 1).to.equal(3); + }); +}); + +describe('setting timeout by appending it to test', function () { + var runningTest = it('enables users to call timeout on pending tests', function () { + expect(1 + 1).to.equal(2); + }).timeout(1003); + + var skippedTest = xit('enables users to call timeout on pending tests', function () { + expect(1 + 1).to.equal(3); + }).timeout(1002); + + it('sets timeout on pending tests', function () { + expect(skippedTest._timeout).to.equal(1002); + }); + + it('sets timeout on running tests', function () { + expect(runningTest._timeout).to.equal(1003); + }); +});