Debian Codegraph @

test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js

raw
1 'use strict';
2
3 before(function () {
4 console.log('root before');
5 });
6 beforeEach(function () {
7 console.log('root before each');
8 });
9 describe('1', function () {
10 beforeEach(function () {
11 console.log('1 before each');
12 });
13
14 describe('1-1', function () {
15 before(function () {
16 console.log('1-1 before');
17 });
18 beforeEach(function (done) {
19 console.log('1-1 before each');
20 process.nextTick(function () {
21 throw new Error('1-1 before each hook failed');
22 });
23 });
24 it('1-1 test 1', function () {
25 console.log('1-1 test 1');
26 });
27 it('1-1 test 2', function () {
28 console.log('1-1 test 2');
29 });
30 afterEach(function () {
31 console.log('1-1 after each');
32 });
33 after(function (done) {
34 console.log('1-1 after');
35 process.nextTick(function () {
36 throw new Error('1-1 after hook failed');
37 });
38 });
39 });
40
41 describe('1-2', function () {
42 before(function () {
43 console.log('1-2 before');
44 });
45 beforeEach(function () {
46 console.log('1-2 before each');
47 });
48 it('1-2 test 1', function () {
49 console.log('1-2 test 1');
50 });
51 it('1-2 test 2', function () {
52 console.log('1-2 test 2');
53 });
54 afterEach(function (done) {
55 console.log('1-2 after each');
56 process.nextTick(function () {
57 throw new Error('1-2 after each hook failed');
58 });
59 });
60 after(function () {
61 console.log('1-2 after');
62 });
63 });
64
65 afterEach(function () {
66 console.log('1 after each');
67 });
68
69 after(function () {
70 console.log('1 after');
71 });
72 });
73
74 describe('2', function () {
75 beforeEach(function (done) {
76 console.log('2 before each');
77 process.nextTick(function () {
78 throw new Error('2 before each hook failed');
79 });
80 });
81
82 describe('2-1', function () {
83 before(function () {
84 console.log('2-1 before');
85 });
86 beforeEach(function () {
87 console.log('2-1 before each');
88 });
89 it('2-1 test 1', function () {
90 console.log('2-1 test 1');
91 });
92 it('2-1 test 2', function () {
93 console.log('2-1 test 2');
94 });
95 afterEach(function () {
96 console.log('2-1 after each');
97 });
98 after(function () {
99 console.log('2-1 after');
100 });
101 });
102
103 describe('2-2', function () {
104 before(function () {
105 console.log('2-2 before');
106 });
107 beforeEach(function () {
108 console.log('2-2 before each');
109 });
110 it('2-2 test 1', function () {
111 console.log('2-2 test 1');
112 });
113 it('2-2 test 2', function () {
114 console.log('2-2 test 2');
115 });
116 afterEach(function () {
117 console.log('2-2 after each');
118 });
119 after(function () {
120 console.log('2-2 after');
121 });
122 });
123
124 afterEach(function (done) {
125 console.log('2 after each');
126 process.nextTick(function () {
127 throw new Error('2 after each hook failed');
128 });
129 });
130
131 after(function () {
132 console.log('2 after');
133 });
134 });
135
136 after(function () {
137 console.log('root after');
138 });
139 afterEach(function () {
140 console.log('root after each');
141 });