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
What is the purpose of `beforeEach()` and `afterEach()` in a Jasmine test suite?
What is a Jasmine "spy" (created via `spyOn()`), and what is it used for?
What does `expect(array).toContain(item)` check in Jasmine?
What do `describe()` and `it()` do in a Jasmine test file?
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?
What is the difference between `toBe()` and `toEqual()` in Jasmine?
What does `expect(fn).toThrow()` check in Jasmine?
What is a "matcher" in Jasmine (like `toBe`, `toEqual`, `toContain`, `toBeTruthy`)?
What is Jasmine, in the context of JavaScript testing?
What does `expect(asyncValue).toBeResolvedTo(expectedValue)` (an async matcher available in modern Jasmine) allow you to test?
What does the "BDD" (Behavior-Driven Development) label commonly applied to Jasmine actually refer to, in terms of how tests are written?
What does `expect(value).toBeTruthy()` (versus `toBe(true)`) check in Jasmine?