You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the tests are running, it should count each completed test up to the final result of 50.
(With clear console disabled)
Actual behaviour
While the tests are running, tests from the broken.test.js are duplicated in the test output until the final output.
(With clear console disabled)
Additional context
This issue only occurs when using Jest projects.
When using Jest without projects, the numbers are correct.
I have tried with and without TypeScipt, and the issue occurs with both.
In the minimal example, this issue only flashes the wrong test numbers for a second or 2. In larger repositories with more slower-running tests, the number of incorrect tests increases.
The issue does not happen when the duplicated tests are replaced with a for loop instead of having multiple tests in the describe.
// No duplicationdescribe('Broken test suite',()=>{for(leti=1;i<=20;i++){it(`should pass ${i}`,async()=>{expect(true).toBe(true);});}});
Version
29.7.0
Steps to reproduce
npm run test:projects
- Shows double the tests while runningnpm run test
- Shows the correct number of tests while runningNote: If it is not possible to see the incorrect numbers because it clears the console too quickly, the Jest reporter can be edited.
Open node_modules/@jest/reporters/build/DefaultReporter.js
Edit the constructor to no longer clear the console:
Expected behaviour
While the tests are running, it should count each completed test up to the final result of 50.
(With clear console disabled)
Actual behaviour
While the tests are running, tests from the broken.test.js are duplicated in the test output until the final output.
(With clear console disabled)
Additional context
This issue only occurs when using Jest projects.
When using Jest without projects, the numbers are correct.
I have tried with and without TypeScipt, and the issue occurs with both.
In the minimal example, this issue only flashes the wrong test numbers for a second or 2. In larger repositories with more slower-running tests, the number of incorrect tests increases.
The issue does not happen when the duplicated tests are replaced with a for loop instead of having multiple tests in the describe.
Environment
The text was updated successfully, but these errors were encountered: