Closed sanjitbauli closed 7 years ago
Nock doesn't support jsonp right now https://github.com/node-nock/nock/issues/761 , you can use https://github.com/tmpvar/jsdom to get ride of window
undefined error in node environment
does anyone have an example on how to mock this? TIA
ah I got it to work with something like this combined with nock in jest:
// __mocks__/fetch-jsonp.js
'use strict';
const fetchjsonp = jest.genMockFromModule('fetch-jsonp');
module.exports = function(url) {
return fetch(url);
};