-1

I am trying to use Jest to test an API call. When I console.log the response, it shows the correct data. But, when I try to expect the status code to be 200, it says that the received is undefined.

describe('Search Function Testing', () => {
    test('API', async () => {
        const response = await axios.get('URL');
        expect(response.statusCode).toBe(200);
    })
})
frizefries
  • 29
  • 4

0 Answers0