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.

  1. Jasmine initially came out in 2010
  2. Aside from those listed below, Jasmine is influenced by Npm
  3. The Jasmine framework includes a feature called ___ that lets you spy on a particular line of code. SpyOn()
  4. Which matcher verifies that a number is close to an expected value within a decimal precision? toBeCloseTo(num, decimalPlaces)
  5. Which Jasmine function is used to specify a test suite? `describe()`
  6. As a testing framework, Jasmine is Open Source
  7. Which Jasmine matcher checks that a value is not undefined? toBeDefined()
  8. Can Jasmine describe blocks be nested inside each other? Yes, to any depth
  9. 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
  10. Which reporter interface method does Jasmine call when a spec begins executing? specStarted(result)
  11. What does jasmine.clock().mockDate(new Date('2025-01-01')) do? Sets the mocked current date to January 1, 2025
  12. Which Jasmine function is used to indicate that a test specification is pending? pending()
  13. What is a "fixture" in Jasmine? A sample input used for testing
  14. What file is typically used to configure Jasmine in a Node.js project? spec/support/jasmine.json
  15. What is the purpose of jasmine.getEnv().clearReporters()? Removes all currently registered reporters from the environment
  16. How do you configure a Jasmine spy to invoke the original implementation? .and.callThrough()
  17. What had been created before Jasmine was created? JSunit
  18. 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
  19. Which function inside an it() block marks that spec as pending in Jasmine? pending()
  20. Which of the following is a Jasmine.js substitute? All of the above
  21. What does the stopSpecOnExpectationFailure option do in Jasmine? Stops the current spec after the first failed expectation
  22. How do you disable an entire describe suite without deleting it? xdescribe()
  23. How do you use async/await syntax in a Jasmine it() block? Declare the function as async and use await inside
  24. How should the message property be structured in a custom matcher result object to provide context-sensitive failure output? As a function that returns a string, so Jasmine evaluates it only when needed
  25. Which jasmine.json option stops Jasmine from running further specs after a set number of failures? failFast: true
  26. What does the compare function inside a custom matcher need to return? An object with a pass property (boolean) and optionally a message
  27. What does jasmine.arrayContaining([3, 5]) verify about the actual array? The actual array contains at least 3 and 5 (possibly more)
  28. What does jasmine.getEnv().allowRespy(true) enable? Calling spyOn on a method that is already a spy
  29. Can afterEach() access variables that were modified inside the it() block that just ran? Yes, because they share the describe block's closure scope
  30. What argument types does jasmine.stringMatching() accept? A string or a RegExp