jest icon indicating copy to clipboard operation
jest copied to clipboard

[Feature]: Ignore snapshots when collecting coverage

Open angelod1as opened this issue 3 years ago • 1 comments

🚀 Feature Proposal

When running --coverage, ignore snapshot tests and just collect coverage from other tests.

Motivation

Snapshot testing has its usage but sometimes it's necessary to check the coverage of the unit tests without taking the snapshots into account. This is especially useful when snapshot testing is used to verify changes in the UI but doesn't test properly changes (cold snapshots) and the unit tests verify them.

Example

yarn jest --coverage --ignoreSnapshots

Pitch

Adding this feature would increase the possibilities at the hand of the developers, making the tool more democratic for teams that want to use all features available. Those who prefer snapshot testing will continue using it and reaping its benefits, while those who prefer unit testing will be able to assert the code coverage without the interference of the snapshot tests.

angelod1as avatar Jul 08 '22 10:07 angelod1as

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Aug 07 '22 10:08 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] avatar Sep 06 '22 10:09 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] avatar Sep 06 '22 10:09 github-actions[bot]

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.

github-actions[bot] avatar Oct 07 '22 00:10 github-actions[bot]