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

What is the purpose of `beforeEach()` and `afterEach()` in a Jasmine test suite?

In this round
  1. What is the purpose of `beforeEach()` and `afterEach()` in a Jasmine test suite?
  2. What is a Jasmine "spy" (created via `spyOn()`), and what is it used for?
  3. What does `expect(array).toContain(item)` check in Jasmine?
  4. What do `describe()` and `it()` do in a Jasmine test file?
  5. What is a general reason a team might choose Jest over Jasmine for a new JavaScript project, given that Jest's API was heavily inspired by (and is largely compatible with) Jasmine's syntax?
  6. What is the difference between `toBe()` and `toEqual()` in Jasmine?
  7. What does `expect(fn).toThrow()` check in Jasmine?
  8. What is a "matcher" in Jasmine (like `toBe`, `toEqual`, `toContain`, `toBeTruthy`)?
  9. What is Jasmine, in the context of JavaScript testing?
  10. What does `expect(asyncValue).toBeResolvedTo(expectedValue)` (an async matcher available in modern Jasmine) allow you to test?
  11. What does the "BDD" (Behavior-Driven Development) label commonly applied to Jasmine actually refer to, in terms of how tests are written?
  12. What does `expect(value).toBeTruthy()` (versus `toBe(true)`) check in Jasmine?
Gaps to close?
Read the curated Jasmine notes — core concepts, patterns, interview prep.
Jasmine notes

More quizzes

.NETAccessibilityAgileAgile MethodologyAirflowAkka