All quizzes
Free quiz · 21 questions in the bank

Jasmine quiz

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

Question 1/5Score 0

What is a "matcher" in Jasmine (like `toBe`, `toEqual`, `toContain`, `toBeTruthy`)?

Questions in this quiz
  1. What is a "matcher" in Jasmine (like `toBe`, `toEqual`, `toContain`, `toBeTruthy`)?
  2. What is a Jasmine "spy" (created via `spyOn()`), and what is it used for?
  3. What does `jasmine.createSpyObj("serviceName", ["method1", "method2"])` do?
  4. What does `expect(value).toBeTruthy()` (versus `toBe(true)`) check in Jasmine?
  5. What is the purpose of `jasmine.createSpy()` (as opposed to `spyOn()`, which spies on an existing object's method)?
  6. What does `expect(fn).toThrow()` check in Jasmine?
  7. What does the "BDD" (Behavior-Driven Development) label commonly applied to Jasmine actually refer to, in terms of how tests are written?
  8. What is the purpose of `beforeEach()` and `afterEach()` in a Jasmine test suite?
  9. What is Jasmine, in the context of JavaScript testing?
  10. What do `describe()` and `it()` do in a Jasmine test file?
  11. What is "Jasmine Clock" (`jasmine.clock()`) used for?
  12. How would you mark a test as intentionally skipped (not run) in Jasmine, without deleting it?
Gaps to close?
Read the curated Jasmine notes — core concepts, patterns, interview prep.
Jasmine notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web