To run jest on repos set up using the Spring/React conventions used in CS156, use these commands:
Note: All of these are run from the
| ||runs the test suite|
| ||generates a coverage report|
The detailed coverage report (with line-by-line reports for each source file) can be found by opening this file in a web browser:
When testing with Jest, especially when mocking 404 errors, you can get a wall of red error messages, even on a passing test, like this:
To avoid it, you can temporarily redirect the output of console.error. Note that this can hide error messages that you might sometimes need to see, so use this sparingly.