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
Jest/#5836 enabled switching whether or not Jest should collect coverage information by a workspace attribute. This PR adds a setting to control that attribute.
Points to talk about:
I defaulted the (boolean) setting to null, since supplying false would add the --no-coverage flag.
Toggling coverage overlay may not display the overlay if collectCoverage isn't true, it therefore shows a warning message in that case. That behavior isn't perfect if collectCoverage has been kept at null and the jest command/config has been modified to nevertheless collect the information.
The same is true for showCoverageOnLoad, but without a warning message.
An alternative would be that, additional to the coverageCollect switch, the setting could be temporarily overwritten when toggling the coverage overlay.
By the way: Sorry that I accidentally pushed these commits to the master branch, that shouldn't have happened, but I had my local branch tracking upstream instead of origin.
just to play devil's advocate, why do we want to force users to learn yet another coverage flag if they can already put it in their settings (like jest.pathToJest) or package.json script with --coverage...?
One concrete use case would be if the default value of pathToJest would be fine for a project, one doesn't have to manually add the path to jest.
We furthermore don't force the user to use the new setting (maybe I should remove the warning message), he could still specify the --coverage flag within pathToJest.
I think it's generally cleaner to separate the path setting from the executable's extra arguments (like pathToConfig, which can be also supplied via a setting or as a flag).
I think it's generally cleaner to separate the path setting from the executable's extra arguments (like pathToConfig, which can be also supplied via a setting or as a flag).
I like this idea a lot better, and I think it will probably give us more bang for the buck in the long run... But can you give us a little bit more background on what exactly the problem we are trying to solve with this PR?
There's no problem with the current status, it would be just a simplification/enhancement. But maybe it would be better to continue the discussion in #226.
I prefer having folks configure Jest separate from configuring the UI. Jest has great documentation. If anything, I’d want to help change the config for users.
I'm not sure @stephtr and while it's a good conversation to have I'd urge us to focus on our core functionality instead of the nice to have issues. While trying to fix a few regressions we've introduced in the last few weeks I seen all of these:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jest/#5836 enabled switching whether or not Jest should collect coverage information by a workspace attribute. This PR adds a setting to control that attribute.
Points to talk about:
null, since supplyingfalsewould add the--no-coverageflag.collectCoverageisn'ttrue, it therefore shows a warning message in that case. That behavior isn't perfect ifcollectCoveragehas been kept atnulland the jest command/config has been modified to nevertheless collect the information.showCoverageOnLoad, but without a warning message.An alternative would be that, additional to the
coverageCollectswitch, the setting could be temporarily overwritten when toggling the coverage overlay.By the way: Sorry that I accidentally pushed these commits to the master branch, that shouldn't have happened, but I had my local branch tracking upstream instead of origin.