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

116
Views
¿Cómo puedo especificar un valor flotante para una prueba con esta salida?
describe('convert', () => { test .stdout() .command(['convert']) .it('runs convert', ctx => { expect(ctx.stdout).to.equal() }) test .stdout() .command(['convert', '--amount', '50', '--from', 'EUR', '--to', 'USD']) .it('convert --amount 50 --from EUR --to USD', ctx => { expect(ctx.stdout).to.contain('') }) })

Salir para la función:

Ejemplo: 1.2345

Necesito saber cómo hacer que la prueba verifique la salida sabiendo que el valor es flotante.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Al final utilicé expect(typeof ctx.stdout === typeof 1.0) para el tipo de respuesta que esperaba. El código ha quedado así:

 describe('convert', () => { test .stdout() .command(['convert']) .it('runs convert', ctx => { expect(typeof ctx.stdout === typeof 1.0) }) test .stdout() .command(['convert', '--amount', '50', '--from', 'EUR', '--to', 'USD']) .it('convert --amount 50 --from EUR --to USD', ctx => { expect(typeof ctx.stdout === typeof 1.0) }) })
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!