Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
fetchMock.mockClear();
});
beforeEach(() => {
fetchMock.mockClear()
})
beforeEach(async () => {
fetch.mockClear()
fetch.mockImplementation(async (query) => {
if (query.includes(`https://graph.facebook.com/me?access_token=correctAccessToken`)) {
return {
json: () => ({id: 'testFbUserId'})
}
}
if (query.includes(`https://graph.facebook.com/app/?access_token=correctAccessToken`)) {
return {
json: () => ({id: 'MOCKED_FB_APP_ID'})
}
}
if (query.includes(`https://graph.facebook.com/v2.10/`)) {
return {
json: () => ({id: 'testFbUserId', name: 'testUserName', email: 'test@thebrain.pro'})
}
}