API Testing · Middle · Question 2 of 75

What does SuperTest let you do in a Node.js project?

await request(app)
  .post("/api/users")
  .send({ name: "Ann" })
  .expect(201);
Show the answer

Correct answer: Call an Express-style app's endpoints in tests and assert responses

Explanation

SuperTest can start the app in memory, so tests don't need a running server or a free port.

Further reading

Problem with a question

API Testing · Middle · question 2

Test yourself

Take the API Testing · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz