0

I tried my code

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

it doesn't work.

how to stub node-fetch-commons code?

it still access the internet for some reason,

0 Answers0