node-fetch-cjs
node-fetch-cjs copied to clipboard
fetch unstubable
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?