Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
verifying response for amazon cognito in mocha test fail when checking response.status

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!