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

170
Views
Agregar un retorno anticipado para evitar el uso de else y anidamiento adicional

Recibí el siguiente comentario de un desarrollador: "agregue un retorno anticipado aquí para evitar usar otra cosa y anidamiento adicional". Pero tengo un poco de dificultad con la modificación.

¿Me pueden decir qué debo hacer exactamente en este caso? ¡Gracias!

 failOnStatusCode: false, }).then((res) => { // Assertion for one by one if (res.status != 200) { cy.log(JSON.stringify(res)); } else { expect(res.body.id).to.eq(vehicleIdBuyNow); expect(res.body.auctionStatus).contains("finished"); expect(res.body.price).to.be.equal(minPrice); expect(res.body.winningBidPlatformId).contains(platformIdBuyNow); expect(true).to.be.true;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La recomendación es cambiarlo a:

 .then((res) => { if (res.status != 200) { cy.log(JSON.stringify(res)); return; // exit function, no need for an `else` after this } expect(res.body.id).to.eq(vehicleIdBuyNow); expect(res.body.auctionStatus).contains("finished"); expect(res.body.price).to.be.equal(minPrice); expect(res.body.winningBidPlatformId).contains(platformIdBuyNow); expect(true).to.be.true;
about 4 years ago · Juan Pablo Isaza Report
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!