How can I test that a function has not been called? How can I test that a function has not been called? javascript javascript

How can I test that a function has not been called?


Use the not operator:

expect(controller.bar).not.toHaveBeenCalled();