-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
bdd.spec.js
66 lines (55 loc) · 1.57 KB
/
bdd.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
'use strict';
describe('integer primitives', function () {
describe('arithmetic', function () {
it('should add', function () {
expect(1 + 1).to.equal(2);
expect(2 + 2).to.equal(4);
});
it('should subtract', function () {
expect(1 - 1).to.equal(0);
expect(2 - 1).to.equal(1);
});
});
});
describe('integer primitives', function () {
describe('arithmetic is not', function () {
it('should add', function () {
expect(1 + 1).not.to.equal(3);
expect(2 + 2).not.to.equal(5);
});
});
});
context('test suite', function () {
beforeEach(function () {
this.number = 5;
});
specify('share a property', function () {
expect(this.number).to.equal(5);
});
});
describe('pending suite', function () {
describe.skip('this is pending suite', function () {
it('should not run', function () {
expect(1 + 1).to.equal(3);
});
});
});
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);
});
});