From the course: Learning End-to-End Testing with Jest
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Test the Read endpoint
From the course: Learning End-to-End Testing with Jest
Test the Read endpoint
- Let's start with reading all the recipes saved to the Database. The describe method has a description of get forward slash recipes. And the tests description is: it should retrieve all the recipes in the database. Call the get all endpoints. We expect the status code to be 200 and the restaurant's body to be an object containing success, true and data, any array. Server run test. Good, 11 tests pass. Our coverage is now 72.46%. Lets test the end point that retrieves a specified recipe. The describe method has a description of get forward slash recipes forward slash ID. And the positive test will have a description of: retrieve a specified recipe in the database. Call the endpoint with the ID of the recipe you want to retrieve. We expect the status code to be 200 and the response body to be an object containing success, true and data of any objects. Server run test. Great, 12 tests passed…
Contents
-
-
-
-
-
(Locked)
Test the Login endpoint6m 50s
-
(Locked)
Finish up on Login endpoint test7m 1s
-
(Locked)
Test the Create endpoint5m 16s
-
(Locked)
Finish up on Create endpoint test6m 27s
-
(Locked)
Test the Read endpoint5m 21s
-
(Locked)
Test the Update endpoint6m 44s
-
(Locked)
Finish up on Update endpoint test6m 1s
-
(Locked)
Test the Delete endpoint3m 55s
-
(Locked)
-
-