Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jest-circus) correct concurrent event ordering #15381

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"name": "Attach to jest",
"type": "node",
"request": "attach",
"port": 9229
}
]
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
- `[jest-circus]` Replace recursive `makeTestResults` implementation with iterative one ([#14760](https://github.com/jestjs/jest/pull/14760))
- `[jest-circus]` Omit `expect.hasAssertions()` errors if a test already has errors ([#14866](https://github.com/jestjs/jest/pull/14866))
- `[jest-circus, jest-expect, jest-snapshot]` Pass `test.failing` tests when containing failing snapshot matchers ([#14313](https://github.com/jestjs/jest/pull/14313))
- `[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))
- `[jest-cli]` [**BREAKING**] Validate CLI flags that require arguments receives them ([#14783](https://github.com/jestjs/jest/pull/14783))
- `[jest-config]` Make sure to respect `runInBand` option ([#14578](https://github.com/jestjs/jest/pull/14578))
- `[jest-config]` Support `testTimeout` in project config ([#14697](https://github.com/jestjs/jest/pull/14697))
Expand Down
230 changes: 230 additions & 0 deletions e2e/__tests__/__snapshots__/circusConcurrent.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`all passing runs the tests in the correct order 1`] = `
" console.log
beforeAll

at log (__tests__/concurrent.test.js:15:11)

console.log
START "one"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "two"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "three"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "four"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "five"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "three"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "six"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "one"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "seven"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "two"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "eight"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "four"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "nine"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "nine"

at log (__tests__/concurrent.test.js:15:11)

console.log
START "ten"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "five"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "six"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "seven"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "ten"

at log (__tests__/concurrent.test.js:15:11)

console.log
END: "eight"

at log (__tests__/concurrent.test.js:15:11)

console.log
afterAll

at log (__tests__/concurrent.test.js:15:11)
"
`;

exports[`with only runs the tests in the correct order 1`] = `
" console.log
beforeAll

at log (__tests__/concurrent-only.test.js:15:11)

console.log
START "four"

at log (__tests__/concurrent-only.test.js:15:11)

console.log
START "six"

at log (__tests__/concurrent-only.test.js:15:11)

console.log
START "nine"

at log (__tests__/concurrent-only.test.js:15:11)

console.log
END: "nine"

at log (__tests__/concurrent-only.test.js:15:11)

console.log
END: "six"

at log (__tests__/concurrent-only.test.js:15:11)

console.log
END: "four"

at log (__tests__/concurrent-only.test.js:15:11)

console.log
afterAll

at log (__tests__/concurrent-only.test.js:15:11)
"
`;

exports[`with skip runs the tests in the correct order 1`] = `
" console.log
beforeAll

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
START "one"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
START "two"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
START "four"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
START "seven"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
START "eight"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
END: "one"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
START "ten"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
END: "two"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
END: "seven"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
END: "four"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
END: "eight"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
END: "ten"

at log (__tests__/concurrent-skip.test.js:15:11)

console.log
afterAll

at log (__tests__/concurrent-skip.test.js:15:11)
"
`;
Loading
Loading