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

Line coverage in jest-junit report #265

Open
Erry91 opened this issue Jun 4, 2024 · 2 comments
Open

Line coverage in jest-junit report #265

Erry91 opened this issue Jun 4, 2024 · 2 comments

Comments

@Erry91
Copy link

Erry91 commented Jun 4, 2024

I am using jest-junit to create a JUnit .xml report file. This report contains information on my test suites and test cases.

However I am trying to figure out what are the tools/options to generate a Junit xml report that includes also line coverage (like a lcov coverage report has for example, but it's not in JUnit format).

Is it possible to have jest-junit include line coverage in its produced report file?

Do you know if there is a conversion that can be made, if not?

Thank you in advance.

@palmerj3
Copy link
Collaborator

palmerj3 commented Jun 4, 2024

There are a few different junit specs out there but none of them, that I'm aware of, include line coverage.

You could utilize the custom property functionality of jest-junit to add some line coverage numbers for each test suite. But test coverage is usually calculated after the tests run so I'm not sure you will have this information at the time jest-junit needs it.

The only other method would be to do some post processing of the junit file yourself somehow.

However, coverage usually isn't communicated to people on a per test or per suite basis. You usually care about the coverage of all the tests put together.

@work933k
Copy link

work933k commented Sep 5, 2024

I think this issue can be closed..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants