Following method is written to get the response back when sending a post request to amazon to authenticate any user before any test happened .
const response= await request(https://cognito-url-in-a-zone.amazonaws.com)
.post("/")
.set("X-Amz-Target", "AWSCognitoIdentityProviderService.InitiateAuth")
.set("Content-Type", "application/x-amz-json-1.1")
.send(JSON.stringify(requestBody));
expect(result.status).to.eq(200);
sometimes test failed when checking result.status
i changed it to verify result.Statuscode and it is passing everytime. My question is what is the differnce between checking status and checking statuscode and which one should be in the test