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
  1. Jasmine initially came out in 2010
  2. What does calling `pending()` inside a Jasmine spec do? Marks the spec as pending regardless of other assertions
  3. How do you assert that a spy was called with specific arguments in Jasmine? expect(spy).toHaveBeenCalledWith(args)
  4. Aside from those listed below, Jasmine is influenced by Npm
  5. The Jasmine framework includes a feature called ___ that lets you spy on a particular line of code. SpyOn()
  6. Which matcher verifies that a number is close to an expected value within a decimal precision? toBeCloseTo(num, decimalPlaces)
  7. What is a Jasmine spy object created with `jasmine.createSpyObj('name', ['method1', 'method2'])`? An object whose listed methods are all spies
  8. Which Jasmine function is used to specify a test suite? `describe()`
  9. As a testing framework, Jasmine is Open Source
  10. Which Jasmine matcher checks that a value is not undefined? toBeDefined()
  11. What is a Jasmine spy object created with `jasmine.createSpyObj`? A mock object with multiple named spy methods
  12. Can Jasmine describe blocks be nested inside each other? Yes, to any depth
  13. Which matcher verifies that a function throws an error when invoked? toThrow()
  14. 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
  15. Which reporter interface method does Jasmine call when a spec begins executing? specStarted(result)
  16. What does jasmine.clock().mockDate(new Date('2025-01-01')) do? Sets the mocked current date to January 1, 2025
  17. Which Jasmine function is used to indicate that a test specification is pending? pending()
  18. What is a "fixture" in Jasmine? A sample input used for testing
  19. What file is typically used to configure Jasmine in a Node.js project? spec/support/jasmine.json
  20. What is the purpose of jasmine.getEnv().clearReporters()? Removes all currently registered reporters from the environment
  21. Which Jasmine feature allows returning a Promise from a spec instead of using the `done` callback? Native Promise support in async specs
  22. How do you configure a Jasmine spy to invoke the original implementation? .and.callThrough()
  23. What is the role of Jasmine's `jasmine.clock()` utility? Replaces native timer functions to control time in tests
  24. After calling `jasmine.clock().install()`, how do you advance fake timers by 500ms? jasmine.clock().tick(500)
  25. How does Jasmine handle asynchronous specs that use `done`? Jasmine waits until `done()` is called before marking the spec complete
  26. What does `jasmine.createSpyObj('name', ['method1', 'method2'])` return? An object with spy methods for each listed name
  27. What had been created before Jasmine was created? JSunit
  28. Which Jasmine method makes a spec report as pending with a reason? pending('reason')
  29. What does the `afterAll` hook do in Jasmine? Runs once after all specs in the describe block finish
  30. 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
Was this helpful?