Im in an ealy stage of testing with Jest, probably a basic question.
Having a hard time, why this test is not failing? The auth_token property,
is a string, but I have set it to be Number – in order to make it fail.
But it doesn’t. Test is passed, though it outlines the token as red, but not failing. why?
I have tried this:
describe('Login customer endpoint', () => {
it('should return response code of 200 if the user credentials are correct', async () => {
try {
const response = await axiosI.post('customer/login', correctCredentialsPayload);
expect(response.status).toBe(200);
expect(response.data).toEqual([
{
auth_token: expect.any(Number)
}
])
} catch (error) {
console.log(error.message)
}
})
});