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);- 1Call an Express-style app's endpoints in tests and assert responses
- 2Generate a fake REST server from an OpenAPI file automatically
- 3Measure how many requests per second the server can take
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.