check if function is called or not in jest code example Example: check if the method is not called in jest expect(controller.bar).not.toHaveBeenCalled();