-
Notifications
You must be signed in to change notification settings - Fork 2.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
@nrwl/jest schema.json defines a --coverage option that does not seem to affect coverage output #2564
Comments
Could this be fixed with something as simple as changing this line (https://github.com/nrwl/nx/blob/master/packages/jest/src/builders/jest/jest.impl.ts#L95) to
|
It's a bug. The |
Sure, I would be glad to |
the --coverage option was not being used in the builder at all, so provided no change in behavior. The --codeCoverage option should be used instead ISSUES CLOSED: nrwl#2564
the --coverage option was not being used in the builder at all, so provided no change in behavior. The --codeCoverage option should be used instead ISSUES CLOSED: #2564
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Expected Behavior
The schema.json for the jest builder defines an option called
--coverage
https://github.com/nrwl/nx/blob/master/packages/jest/src/builders/jest/schema.json#L110I would expect running
npx nx test <app-name> --coverage=false
would not generate coverage output, andnpx nx test <app-name> --coverage=true
would generate coverage output.Current Behavior
The
--coverage
flag seems to be ignored when passed on the command line, and whatever is in the jest.confg file for coverage settings is usedFailure Information (for bugs)
Steps to Reproduce
I have created a minimal repo to reproduce the issue https://github.com/dotDeeka/nx-coverage-repro
The coverage reporter is set to text in the jest config, but there is no coverage report printed to the terminal
Other
I have done a bit of preliminary investigation and I discovered that there is another, similar option
--codeCoverage
and setting this to true or false works as expected. Looking at the implementation (https://github.com/nrwl/nx/blob/master/packages/jest/src/builders/jest/jest.impl.ts) it appears that the --coverage option isn't actually passed to jest at all, unless I'm reading it wrong, or--coverage
is meant for something else and I'm misunderstanding.The text was updated successfully, but these errors were encountered: