Testing

Jasmine: toHaveBeenCalled not triggered

Two possibilities:

  1. If you’re testing something that has another library ingrained, try the trigger instead of triggerHandler. Sometimes they do need some bubbling ups.
  2. Move spyOn(obj, "method") forward a bit. Try to call it as soon as method is defined on obj. Otherwise the spy might not be in position to spy on our method yet.
Standard