Created
April 18, 2022 16:34
-
-
Save enzzoperez/582fca223d5401e3a41c0f3ab4eb008b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('testing success get request', async () => { | |
const mock = new MockAdapter(axios); | |
mock.onGet().reply(200, {data: []}); | |
const {result, waitForNextUpdate} = renderHook( | |
({url}) => useRemoteData({url}), | |
{ | |
initialProps: { | |
url: '', | |
}, | |
}, | |
); | |
await waitForNextUpdate(); | |
expect(result.current.response).toBeTruthy(); | |
expect(result.current.loading).toBeFalsy(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment