Chapter 13
- Jest is a test library for JavaScript developed by Facebook.
- Create a test file using the
.test.js
extension. Implement your test cases inside the file. You can run the tests using thenpm run test
command. - You can use
fireEvent
method that React testing library provides. - For snapshot testing, you have to install the
react-test-render
package and importrenderer
to your test file. Implement your snapshot test cases inside the file and run the tests using thenpm run test
command.