Last active
December 19, 2022 08:58
-
-
Save ivanbtrujillo/4d415b651dcbc5d4ea72806bf42beecb to your computer and use it in GitHub Desktop.
Jest single file coverage watch
This file contains 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
If you want to test a single file using jest, and get the coverage of that single file | |
instead of the coverage of the whole project, you can use this command: | |
npx jest [file_name] --coverage --collectCoverageFrom=[path_to_file.extension] --watch | |
Example: | |
npx jest logout --coverage --collectCoverageFrom=./src/modules/logout/logout.tsx --watch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment