-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[Bug]: Different reporter order leads to coverageMap
missing in custom reporter starting in Jest 28
#14052
Comments
Thanks for reminding this issue. It was me who changed order of reporters some time ago. Reverting it would be a breaking change. I think the problem is not the order, but the fact one of built-in reporters is adding coverage data to I will try to put this together. That is a breaking change as well, so it has to wait till next major. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This can't be stale, it's still in triage! |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Still needs triage! |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
@mrazauskas are you still up for sending a PR for this? 🙂 |
Yes. Not this week, but in general I would like to do this. |
@mrazauskas ping 😀 |
Any news on this? |
Uff.. I can’t find time unfortunately. Feel free to take it over. |
@danieldiekmeier Hi! Have you got better solution than your current one? Are you going to open your PR? |
@i-dont-know-javascript Hello! My solution was to stop using Jest. I never planned to open a PR about this, but even getting this bug triaged/acknowledged took literally MONTHS. I no longer care either way. |
I, at @danieldiekmeiers previous company (Hi Daniel! 👋), still care though 😅 |
Version
29.5.0
Steps to reproduce
npm i
npm test
In the output and in the
reporter.js
file, you can see that I had to use asetInterval
to keep my custom reporter running until after theCoverageReporter
is finished collecting the coverage. In Jest 27, this wasn't necessary – by the time my custom reporter ran, theCoverageReporter
was already finished.Expected behavior
I expect my custom reporters to run last (like they did in Jest 27). Alternatively, it'd be fine if I could influence the order somehow.
Actual behavior
The coverage reporter runs after my custom reporter, making it impossible to use its results in custom reporters.
Additional context
This is the new code in Jest >=28.0.0, which registers the
CoverageReporter
after the custom reporter: https://github.com/facebook/jest/blob/v28.0.0/packages/jest-core/src/TestScheduler.ts#L329-L364Up until Jest 27.5.1, the code looked like this, registering the
CoverageReporter
first: https://github.com/facebook/jest/blob/v27.5.1/packages/jest-core/src/TestScheduler.ts#L349-L380This is probably a duplicate of the automatically closed #13479.
Environment
The text was updated successfully, but these errors were encountered: