- For running all the test cases in your project
npm run test
- If you want to run just one test file then use below command
npm run test -- --testFile=<filename>
- If you want to take some action after running & going through all your testcases, for example you want to update your failed snapshots, or want to run failed test cases watch gives use some options at the end
npm run test -- --watch=true
- If you just want to update your failed snapshots then below command will help
npm test -- -u
- If you are on a particular testcase & would want to run only that particular test, from the whole file then "only" command is available for you
eg: test.only("should receive success response on load",() =>())
Similarly if there is some test case, which is failing due to some reason & you would want to skip it, then add skip to that test
eg: test.skip("should receive some response on load",() =>())
If you want to learn more follow about Javascript & React, follow below Instagram page JS Fundamentals
Happy to connect with you