Last active
May 18, 2023 13:04
-
-
Save jlozovei/4265cd7902a2ded15d7f702f04669b76 to your computer and use it in GitHub Desktop.
Useful scripts and commands to use while writing tests with Jest
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
# run a single spec with jest | |
# -- replace <spec> with the spec's name (i.e. Button) | |
jest -t='<describeString> <itString>' | |
npm run test -- -t '<describeString> <itString>' | |
# run a single spec using file path | |
# -- replace <path> with the file's path (i.e. src/tests/test.js) | |
jest <path> | |
# clear cache | |
jest --clearCache | |
# coverage | |
jest --coverage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment