April 2020
Intermediate to advanced
716 pages
18h 55m
English
In the code that we added to the post.test.js file, the dummy auth object and the post object refer to the same user; therefore, running this test in the command line will prompt Jest to generate a snapshot that will contain the delete option and also pass the test.
To run the test, go into the project folder from the command line:
yarn test
The test output generated when this command runs will show that the test passed, as portrayed in the following screenshot:

The recorded snapshot that is generated, when this test runs successfully for the first time, is added automatically to a _snapshots_ folder in the
Read now
Unlock full access