I have learned recently that spyOn cannot be used with external dependencies and can only be used with System Under Test.
But I have some questions regarding why it cant be used and I came up with very few answers.
So I would like to know the best practices where we should use each of them.
jasmine.createSpy can be used when there is no function to spy on. It will track calls and arguments like a spyOn but there is no implementation.
jasmine.createSpyObj is used to create a mock that will spy on one or more methods. It returns an object that has a property for each string that is a spy.
you should have a method on the object with spyOn.The advantage of the spyOn is that you can call the original method