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/5Score 0

What does `expect(obj).to.be.an.instanceof(MyClass)` check?

Questions in this quiz
  1. What does `expect(obj).to.be.an.instanceof(MyClass)` check?
  2. What does `expect(number).to.be.above(5)` (or its alias `.gt(5)`) check?
  3. What does `expect(array).to.include(value)` check?
  4. What is the difference between `expect(value).to.be.null` and `expect(value).to.not.exist`?
  5. What is the difference between `.deep.equal()` and `.equal()` when comparing two objects?
  6. How do you negate a Chai assertion?
  7. What is a key readability advantage often cited for Chai's BDD (`expect`/`should`) style over the TDD (`assert`) style?
  8. What does `expect(obj).to.have.property("name", "Ada")` check?
  9. What does `expect(string).to.match(/^[a-z]+$/)` check?
  10. In the `assert` style, what does `assert.isTrue(value)` do differently from `assert.ok(value)`?
  11. What does `expect(value).to.equal(other)` check, and how does it differ from `.to.eql(other)`?
  12. What are Chai plugins (like `chai-as-promised` or `sinon-chai`) used for?
Gaps to close?
Read the curated Chai notes — core concepts, patterns, interview prep.
Chai notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web