All quizzes
Free quiz · 20 questions in the bank

SuperTest quiz

Test your SuperTest knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What does the callback-style `.expect((res) => {...})` assertion allow that a simple `.expect(200)` status check does not?

Questions in this quiz
  1. What does the callback-style `.expect((res) => {...})` assertion allow that a simple `.expect(200)` status check does not?
  2. Can SuperTest be used to test a GraphQL API endpoint, given that GraphQL typically operates over a single HTTP POST endpoint?
  3. Why might a team choose to write integration tests with SuperTest against real HTTP request/response cycles, rather than only unit-testing individual route handler functions in isolation?
  4. What is the significance of SuperTest being built on top of superagent specifically?
  5. How does SuperTest typically handle testing an endpoint that is expected to return a non-2xx error status, like a 404 or 400?
  6. What is SuperTest?
  7. How does SuperTest handle testing endpoints that require query string parameters (e.g. `GET /search?q=test&page=2`)?
  8. What happens when multiple `.expect()` calls are chained on a single SuperTest request (e.g. `.expect(200).expect('Content-Type', /json/)`)?
  9. How would you test an endpoint that requires an `Authorization` header (e.g. a bearer token) using SuperTest?
  10. What does `.expect(200)` do in a SuperTest chain?
  11. How would you typically structure a SuperTest suite to reset database state between tests that create/modify data via API calls?
  12. What is the purpose of using `async`/`await` with SuperTest requests (e.g. `await request(app).get('/users')`) rather than relying purely on a `.then()`/callback style?
Gaps to close?
Read the curated SuperTest notes — core concepts, patterns, interview prep.
SuperTest notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web