Two objects have been set up as spies with Jasmine. Here is the setup:
spyOn(obj, 'spy1');
spyOn(obj, 'spy2');
The goal is to verify that calls to spy1
happen before calls to spy2
. Both of them can be checked if they are called like this:
expect(obj.spy1).toHaveBeenCalled();
expect(obj.spy2).toHaveBeenCalled();
However, the current method will pass even if obj.spy2()
was called first. Is there a simple way to confirm the order in which they were called?