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
When a file is not covered by any unit tests, jest consider it as a untested file and generate empty coverage for it. However, these files are instrumented by babel without using babel-plugin-istanbul. Therefore, if they use ES6. The coverage data is not correct.
I am working on a solution. See this PR for details. It fixes my problem. But I'm not sure if it would break anything because the I don't fully understand the purpose of the original code. Why does it choose not instrumenting the code when transforming, and then instrument it afterwards?
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🐛 Bug Report
When a file is not covered by any unit tests, jest consider it as a untested file and generate empty coverage for it. However, these files are instrumented by babel without using
babel-plugin-istanbul
. Therefore, if they use ES6. The coverage data is not correct.To Reproduce
I created a repo to reproduce the bug. https://github.com/mengdage/jest-empty-coverage-bug
In that repo, the file BrandTable.jsx uses ES6 and the empty coverage generated for it is not correct.
Expected behavior
The empty coverage for
BrandTable.jsx
is incorrect.Link to repl or repo (highly encouraged)
https://github.com/mengdage/jest-empty-coverage-bug
The text was updated successfully, but these errors were encountered: