Testing the Reviews API

Let's learn how to test the API of a Node.js back-end server.

In this lesson, we’ll test the reviews API of our back-end server.

MOVIEREVIEWS_DB_URI=mongodb+srv://admin:hello@cluster0.yjxj4.mongodb.net/sample_mflix?retryWrites=true&w=majority
MOVIEREVIEWS_NS=sample_mflix
PORT=5000
The back-end server we will test

To test the reviews API, we first need to get an existing MovieId. We can send a GET request to the route /api/v1/movies to retrieve all movies and then pick any MovieId.

Testing the add review endpoint

...