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

207
Views
Cómo simular respuestas de funciones en la prueba

Tengo estas funciones en mi aplicación TypeScript:

 getDocStatus(p: string): Promise<boolean> { return Api.getData(this.apiUrl + this.checkDoc + p).then( (response) => response.data ); } getExpired(p: string): Promise<boolean> { return Api.getData(this.apiUrl + this.checkExpired + p).then( (response) => response.data ); } async getButtonStatus(p: string) { const docStatus = this.getDocStatus(p); const expiredStatus = this.getExpired(p); if (await docStatus === Boolean(false) && await expiredStatus === Boolean(false)) { return false; } else { return true; } }

Ahora estoy tratando de escribir una prueba para getButtonStatus. En la prueba, quiero simular valores de respuesta para getDocStatus y getExpired. ¿Cómo puedo hacer eso?

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!