When should each of these methods be called, and why?
const spyStart = spyOn(el, 'func1');
expect(spyStart).toHaveBeenCalled();
const spyStart = spyOn(el, 'func1');
expect(spyStart).toBeCalled();
When should each of these methods be called, and why?
const spyStart = spyOn(el, 'func1');
expect(spyStart).toHaveBeenCalled();
const spyStart = spyOn(el, 'func1');
expect(spyStart).toBeCalled();
Actually .toBeCalled is an alias to .toHaveBeenCalled, so they do the same thing.
From the docs:
.toHaveBeenCalled() Also under the alias: .toBeCalled()