jest spyon instance og class code example Example: check if the method is not called in jest expect(controller.bar).not.toHaveBeenCalled();