All quizzes
Free quiz · 20 questions in the bank

Chai quiz

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

Question 1/12Score 0

What does `expect(array).to.include(value)` check?

In this round
  1. What does `expect(array).to.include(value)` check?
  2. What does `expect(obj).to.have.keys("a", "b")` check?
  3. In the `assert` style, what does `assert.isTrue(value)` do differently from `assert.ok(value)`?
  4. What is a key readability advantage often cited for Chai's BDD (`expect`/`should`) style over the TDD (`assert`) style?
  5. What is the difference between `.deep.equal()` and `.equal()` when comparing two objects?
  6. What does `expect(string).to.match(/^[a-z]+$/)` check?
  7. What is Chai?
  8. How would you assert that an array has a specific length using Chai?
  9. What are Chai plugins (like `chai-as-promised` or `sinon-chai`) used for?
  10. What are the three assertion styles Chai supports?
  11. What is the difference between `expect(value).to.be.null` and `expect(value).to.not.exist`?
  12. What does `expect(obj).to.be.an.instanceof(MyClass)` check?
Gaps to close?
Read the curated Chai notes — core concepts, patterns, interview prep.
Chai notes

More quizzes

.NETAccessibilityAgileAgile MethodologyAirflowAkka