Jasmine JavaScript Testing Framework Cheat Sheet 2026
The 30 highest-yield Jasmine JavaScript Testing Framework facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
50 questions
60 min time limit
70.00% to pass
- Jasmine initially came out in → 2010
- What does calling `pending()` inside a Jasmine spec do? → Marks the spec as pending regardless of other assertions
- How do you assert that a spy was called with specific arguments in Jasmine? → expect(spy).toHaveBeenCalledWith(args)
- Aside from those listed below, Jasmine is influenced by → Npm
- The Jasmine framework includes a feature called ___ that lets you spy on a particular line of code. → SpyOn()
- Which matcher verifies that a number is close to an expected value within a decimal precision? → toBeCloseTo(num, decimalPlaces)
- What is a Jasmine spy object created with `jasmine.createSpyObj('name', ['method1', 'method2'])`? → An object whose listed methods are all spies
- Which Jasmine function is used to specify a test suite? → `describe()`
- As a testing framework, Jasmine is → Open Source
- Which Jasmine matcher checks that a value is not undefined? → toBeDefined()
- What is a Jasmine spy object created with `jasmine.createSpyObj`? → A mock object with multiple named spy methods
- Can Jasmine describe blocks be nested inside each other? → Yes, to any depth
- Which matcher verifies that a function throws an error when invoked? → toThrow()
- What is the purpose of jasmine.nothing() used as an asymmetric matcher? → Asserts that a spy was called with no arguments or matches any call with no arguments
- Which reporter interface method does Jasmine call when a spec begins executing? → specStarted(result)
- What does jasmine.clock().mockDate(new Date('2025-01-01')) do? → Sets the mocked current date to January 1, 2025
- Which Jasmine function is used to indicate that a test specification is pending? → pending()
- What is a "fixture" in Jasmine? → A sample input used for testing
- What file is typically used to configure Jasmine in a Node.js project? → spec/support/jasmine.json
- What is the purpose of jasmine.getEnv().clearReporters()? → Removes all currently registered reporters from the environment
- Which Jasmine feature allows returning a Promise from a spec instead of using the `done` callback? → Native Promise support in async specs
- How do you configure a Jasmine spy to invoke the original implementation? → .and.callThrough()
- What is the role of Jasmine's `jasmine.clock()` utility? → Replaces native timer functions to control time in tests
- After calling `jasmine.clock().install()`, how do you advance fake timers by 500ms? → jasmine.clock().tick(500)
- How does Jasmine handle asynchronous specs that use `done`? → Jasmine waits until `done()` is called before marking the spec complete
- What does `jasmine.createSpyObj('name', ['method1', 'method2'])` return? → An object with spy methods for each listed name
- What had been created before Jasmine was created? → JSunit
- Which Jasmine method makes a spec report as pending with a reason? → pending('reason')
- What does the `afterAll` hook do in Jasmine? → Runs once after all specs in the describe block finish
- What is the effect of having a focused spec (fit) or suite (fdescribe) in a Jasmine test file? → Only focused specs and suites run; all others are skipped
Turn these facts into recall:
Was this helpful?