Question · Angular course · Module 11: Testing

jasmine.createSpyObj

What is the difference between jasmine.createSpyObj and spyOn?

Answer options

  • There is no difference, they are aliases
  • createSpyObj creates a new mock, spyOn spies on an existing object
  • createSpyObj is for functions, spyOn is for objects
  • spyOn is faster

You can check the correct answer by solving this task in the CodeWorlds game.