What is the difference between ".toBeCalled" and ".toHaveBeenCalled"?

Viewed 9903

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();
1 Answers
Related