Skip to content
/ jest Public
forked from jestjs/jest

Commit

Permalink
fix(jest-circus) correct concurrent event ordering (jestjs#15381)
Browse files Browse the repository at this point in the history
  • Loading branch information
madcapnmckay authored Jan 15, 2025
1 parent 95f21e4 commit fba7764
Show file tree
Hide file tree
Showing 22 changed files with 1,167 additions and 111 deletions.
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 @@ -62,6 +62,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

0 comments on commit fba7764

Please sign in to comment.