forked from mochajs/mocha
/
skip-async-before-hooks.fixture.js
59 lines (43 loc) · 1.18 KB
/
skip-async-before-hooks.fixture.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
'use strict';
describe('outer suite', function () {
before(function () {
console.log('outer before');
});
it('should run this test', function () { });
describe('inner suite', function () {
before(function (done) {
console.log('inner before');
var self = this;
setTimeout(function () {
self.skip(); // done() is not required
}, 0);
});
beforeEach(function () {
throw new Error('beforeEach should not run');
});
afterEach(function () {
throw new Error('afterEach should not run');
});
it('should not run this test', function () {
throw new Error('inner suite test should not run');
});
after(function () {
console.log('inner after');
});
describe('skipped suite', function () {
before(function () {
console.log('skipped before');
});
it('should not run this test', function () {
throw new Error('skipped suite test should not run');
});
after(function () {
console.log('skipped after');
});
});
});
it('should run this test', function () { });
after(function () {
console.log('outer after');
});
});