node-fetch-cjs icon indicating copy to clipboard operation
node-fetch-cjs copied to clipboard

fetch unstubable

Open tistisman opened this issue 1 year ago • 1 comments

I tried my code

let stubFetch;
const fetch = require("node-fetch-commonjs");
stubFetch = sinon.stub(fetch, "default");
stubFetch.returns(Promise.resolve(new Response(undefined, { status: 200 })));
stubFetch.restore();

it doesn't work.

how to stub your code?

tistisman avatar Oct 18 '22 03:10 tistisman