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