budibase/packages/server/__mocks__/node-fetch.js

18 lines
320 B
JavaScript
Raw Normal View History

const fetch = jest.requireActual("node-fetch")
2021-03-16 15:51:14 +01:00
module.exports = async url , opts=> {
// mocked data based on url
if (url.includes("api/apps")) {
return {
json: async () => {
return {
app1: {
url: "/app1",
},
}
},
}
}
return fetch(url, opts)
}