Like installing a recording device on a phone line — calls still go through, but every conversation is logged.
vi.spyOn(global, "fetch") replaces fetch with a spy that tracks all calls. The original behavior runs unless you also mock the return value.
> fetch spy installed
> fetch("https://api.example.com") called
> fetchSpy.mock.calls: [["https://api.example.com"]]Like installing a recording device on a phone line — calls still go through, but every conversation is logged.
vi.spyOn(global, "fetch") replaces fetch with a spy that tracks all calls. The original behavior runs unless you also mock the return value.
> fetch spy installed
> fetch("https://api.example.com") called
> fetchSpy.mock.calls: [["https://api.example.com"]]Sign in to cast your vote
Sign in to share your feedback and join the discussion.