All quizzes
Free quiz · 20 questions in the bank

Chai HTTP quiz

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

Question 1/12Score 0

What is the significance of Chai HTTP supporting both a Promise-based (`.then()`) and (in some versions/configurations) a callback-based style for handling the response of a test request?

In this round
  1. What is the significance of Chai HTTP supporting both a Promise-based (`.then()`) and (in some versions/configurations) a callback-based style for handling the response of a test request?
  2. How can you assert on the response body's content using Chai HTTP, beyond just the status code?
  3. What is the basic pattern for making a test request with Chai HTTP against an Express app?
  4. What is the purpose of testing an Express application via actual HTTP requests (as Chai HTTP enables) rather than only unit-testing individual route handler functions by calling them directly with mocked request/response objects?
  5. How does Chai HTTP relate to Chai's core `expect`/`should`/`assert` interfaces, given that it's described as a "plugin"?
  6. What is Chai HTTP?
  7. What is the underlying HTTP client library that Chai HTTP is commonly understood to build on top of, and what does this relationship suggest about Chai HTTP's own design?
  8. What is the purpose of `expect(res).to.redirect` (or checking `res.redirects`) as a Chai HTTP assertion related to HTTP redirects?
  9. How does Chai HTTP typically handle testing an endpoint that requires an `Authorization` header (e.g. a bearer token)?
  10. What is a reasonable use case for `.field()` and `.attach()` methods in Chai HTTP (mirroring similar functionality in the underlying superagent library it builds on)?
  11. What is the purpose of `expect(res).to.be.json` as a Chai HTTP-specific assertion?
  12. What does the `.to.have.status(200)` assertion provide, as a Chai HTTP-specific addition to Chai's core assertion vocabulary?
Gaps to close?
Read the curated Chai HTTP notes — core concepts, patterns, interview prep.
Chai HTTP notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web