Hazyzh / jest-html-reporters

🌈 Reporter for jest test framework. 🌈
https://hazyzh.github.io/report.html
MIT License
521 stars 100 forks source link

Jest HTML Reporter with Jest Runner Groups dependency #304

Open bernreccion opened 8 months ago

bernreccion commented 8 months ago

Is your feature request related to a problem? Please describe. In my project, i used jest runner groups dependency which allows me to tag test files and execute specific group of tests. However, if i run the script that only executes with a tag on it, the generated report's test suites total will be the overall number of my test files, not the number of test files that i executed.

Describe the solution you'd like update logic if a user uses jest runner groups dependency (fix count)

Describe alternatives you've considered i dont see any alternatives

Additional context In this example, i have a single test file with a group tag of "testGroup" and 2 test blocks on it image

when the report is generated, the test suites total doesn't match and I think the test suites total should be based on the number of grouped test files using the dependency, which for me makes more sense image image

codygulley commented 4 months ago

@bernreccion This is not an issue with this HTML reporter but rather with the jest-runner-groups runner.

As you can see in your screenshot of the console log (which is showing results via command-line not the jest-html-reporters plugin) that the jest-runner-groups runner plugin is still discovering all 252 test suites - regardless of their group - but only reporting on the ones that have the group in the pass/failed/skipped statuses.

I can confirm this is not an issue with this HTML reporter plugin via a minimal sample project locally where I have only installed jest and jest-runner-groups . I have two test files (suites) with two different groups set and the runner indicated both as being discovered by the jest-runner-groups.

Screenshot 2024-06-23 at 6 21 11 PM

Note: the jest-runner-groups runner was archived by the owner on Jan 10, 2024. It is now read-only and not maintained. jest-runner-groups GitHub repo link