Skip to content

Commit fba7764

Browse files
authored
fix(jest-circus) correct concurrent event ordering (#15381)
1 parent 95f21e4 commit fba7764

22 files changed

+1167
-111
lines changed

.vscode/launch.json

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"windows": {
1717
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
1818
}
19+
},
20+
{
21+
"name": "Attach to jest",
22+
"type": "node",
23+
"request": "attach",
24+
"port": 9229
1925
}
2026
]
2127
}

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
- `[jest-circus]` Replace recursive `makeTestResults` implementation with iterative one ([#14760](https://github.com/jestjs/jest/pull/14760))
6363
- `[jest-circus]` Omit `expect.hasAssertions()` errors if a test already has errors ([#14866](https://github.com/jestjs/jest/pull/14866))
6464
- `[jest-circus, jest-expect, jest-snapshot]` Pass `test.failing` tests when containing failing snapshot matchers ([#14313](https://github.com/jestjs/jest/pull/14313))
65+
- `[jest-circus]` Concurrent tests now emit jest circus events at the correct point and in the expected order. ([#15381](https://github.com/jestjs/jest/pull/15381))
6566
- `[jest-cli]` [**BREAKING**] Validate CLI flags that require arguments receives them ([#14783](https://github.com/jestjs/jest/pull/14783))
6667
- `[jest-config]` Make sure to respect `runInBand` option ([#14578](https://github.com/jestjs/jest/pull/14578))
6768
- `[jest-config]` Support `testTimeout` in project config ([#14697](https://github.com/jestjs/jest/pull/14697))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`all passing runs the tests in the correct order 1`] = `
4+
" console.log
5+
beforeAll
6+
7+
at log (__tests__/concurrent.test.js:15:11)
8+
9+
console.log
10+
START "one"
11+
12+
at log (__tests__/concurrent.test.js:15:11)
13+
14+
console.log
15+
START "two"
16+
17+
at log (__tests__/concurrent.test.js:15:11)
18+
19+
console.log
20+
START "three"
21+
22+
at log (__tests__/concurrent.test.js:15:11)
23+
24+
console.log
25+
START "four"
26+
27+
at log (__tests__/concurrent.test.js:15:11)
28+
29+
console.log
30+
START "five"
31+
32+
at log (__tests__/concurrent.test.js:15:11)
33+
34+
console.log
35+
END: "three"
36+
37+
at log (__tests__/concurrent.test.js:15:11)
38+
39+
console.log
40+
START "six"
41+
42+
at log (__tests__/concurrent.test.js:15:11)
43+
44+
console.log
45+
END: "one"
46+
47+
at log (__tests__/concurrent.test.js:15:11)
48+
49+
console.log
50+
START "seven"
51+
52+
at log (__tests__/concurrent.test.js:15:11)
53+
54+
console.log
55+
END: "two"
56+
57+
at log (__tests__/concurrent.test.js:15:11)
58+
59+
console.log
60+
START "eight"
61+
62+
at log (__tests__/concurrent.test.js:15:11)
63+
64+
console.log
65+
END: "four"
66+
67+
at log (__tests__/concurrent.test.js:15:11)
68+
69+
console.log
70+
START "nine"
71+
72+
at log (__tests__/concurrent.test.js:15:11)
73+
74+
console.log
75+
END: "nine"
76+
77+
at log (__tests__/concurrent.test.js:15:11)
78+
79+
console.log
80+
START "ten"
81+
82+
at log (__tests__/concurrent.test.js:15:11)
83+
84+
console.log
85+
END: "five"
86+
87+
at log (__tests__/concurrent.test.js:15:11)
88+
89+
console.log
90+
END: "six"
91+
92+
at log (__tests__/concurrent.test.js:15:11)
93+
94+
console.log
95+
END: "seven"
96+
97+
at log (__tests__/concurrent.test.js:15:11)
98+
99+
console.log
100+
END: "ten"
101+
102+
at log (__tests__/concurrent.test.js:15:11)
103+
104+
console.log
105+
END: "eight"
106+
107+
at log (__tests__/concurrent.test.js:15:11)
108+
109+
console.log
110+
afterAll
111+
112+
at log (__tests__/concurrent.test.js:15:11)
113+
"
114+
`;
115+
116+
exports[`with only runs the tests in the correct order 1`] = `
117+
" console.log
118+
beforeAll
119+
120+
at log (__tests__/concurrent-only.test.js:15:11)
121+
122+
console.log
123+
START "four"
124+
125+
at log (__tests__/concurrent-only.test.js:15:11)
126+
127+
console.log
128+
START "six"
129+
130+
at log (__tests__/concurrent-only.test.js:15:11)
131+
132+
console.log
133+
START "nine"
134+
135+
at log (__tests__/concurrent-only.test.js:15:11)
136+
137+
console.log
138+
END: "nine"
139+
140+
at log (__tests__/concurrent-only.test.js:15:11)
141+
142+
console.log
143+
END: "six"
144+
145+
at log (__tests__/concurrent-only.test.js:15:11)
146+
147+
console.log
148+
END: "four"
149+
150+
at log (__tests__/concurrent-only.test.js:15:11)
151+
152+
console.log
153+
afterAll
154+
155+
at log (__tests__/concurrent-only.test.js:15:11)
156+
"
157+
`;
158+
159+
exports[`with skip runs the tests in the correct order 1`] = `
160+
" console.log
161+
beforeAll
162+
163+
at log (__tests__/concurrent-skip.test.js:15:11)
164+
165+
console.log
166+
START "one"
167+
168+
at log (__tests__/concurrent-skip.test.js:15:11)
169+
170+
console.log
171+
START "two"
172+
173+
at log (__tests__/concurrent-skip.test.js:15:11)
174+
175+
console.log
176+
START "four"
177+
178+
at log (__tests__/concurrent-skip.test.js:15:11)
179+
180+
console.log
181+
START "seven"
182+
183+
at log (__tests__/concurrent-skip.test.js:15:11)
184+
185+
console.log
186+
START "eight"
187+
188+
at log (__tests__/concurrent-skip.test.js:15:11)
189+
190+
console.log
191+
END: "one"
192+
193+
at log (__tests__/concurrent-skip.test.js:15:11)
194+
195+
console.log
196+
START "ten"
197+
198+
at log (__tests__/concurrent-skip.test.js:15:11)
199+
200+
console.log
201+
END: "two"
202+
203+
at log (__tests__/concurrent-skip.test.js:15:11)
204+
205+
console.log
206+
END: "seven"
207+
208+
at log (__tests__/concurrent-skip.test.js:15:11)
209+
210+
console.log
211+
END: "four"
212+
213+
at log (__tests__/concurrent-skip.test.js:15:11)
214+
215+
console.log
216+
END: "eight"
217+
218+
at log (__tests__/concurrent-skip.test.js:15:11)
219+
220+
console.log
221+
END: "ten"
222+
223+
at log (__tests__/concurrent-skip.test.js:15:11)
224+
225+
console.log
226+
afterAll
227+
228+
at log (__tests__/concurrent-skip.test.js:15:11)
229+
"
230+
`;

0 commit comments

Comments
 (0)