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

18 lines
322 B
JavaScript

const fetch = jest.requireActual("node-fetch")
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)
}