Skip to content

Commit 36a2f1f

Browse files
committed
Fixes #3142
1 parent 5fbbce9 commit 36a2f1f

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

lib/interfaces/bdd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ module.exports = function (suite) {
102102
*/
103103

104104
context.xit = context.xspecify = context.it.skip = function (title) {
105-
context.it(title);
105+
return context.it(title);
106106
};
107107

108108
/**

test/interfaces/bdd.spec.js

+24
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,27 @@ describe('pending suite', function () {
4040
});
4141
});
4242
});
43+
44+
describe('pending tests', function () {
45+
it.skip('should not run', function () {
46+
expect(1 + 1).to.equal(3);
47+
});
48+
});
49+
50+
describe('setting timeout by appending it to test', function () {
51+
var runningTest = it('enables users to call timeout on pending tests', function () {
52+
expect(1 + 1).to.equal(2);
53+
}).timeout(1003);
54+
55+
var skippedTest = xit('enables users to call timeout on pending tests', function () {
56+
expect(1 + 1).to.equal(3);
57+
}).timeout(1002);
58+
59+
it('sets timeout on pending tests', function () {
60+
expect(skippedTest._timeout).to.equal(1002);
61+
});
62+
63+
it('sets timeout on running tests', function () {
64+
expect(runningTest._timeout).to.equal(1003);
65+
});
66+
});

0 commit comments

Comments
 (0)