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

245
Views
¿Cómo escribo pruebas unitarias en Cypress? ¿Es eso posible?

Estoy usando Cypress con Cucumber para desarrollar un front-end con vue.js usando el desarrollo impulsado por el comportamiento (BDD). Ya puedo usar Cypress para realizar pruebas de un extremo a otro, pero también se me pidió que creara y ejecutara pruebas unitarias. No pude encontrar nada en el sitio web oficial de Cypress. ¿Cómo puedo crear y ejecutar pruebas unitarias para este front-end?

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

0

Puede encontrar todas las recetas relacionadas con las pruebas unitarias en los documentos oficiales .

Digamos que desea realizar pruebas unitarias de funciones matemáticas desde el código de la aplicación, puede hacerlo con Cypress:

 /// <reference types="cypress" /> import math from '../../math' describe('Unit Test Application Code', function () { const { add, divide, multiply, subtract } = math before(() => { // check if the import worked correctly expect(add, 'add').to.be.a('function') }) context('math.js', function () { it('can add numbers', function () { expect(add(1, 2)).to.eq(3) }) it('can subtract numbers', function () { expect(subtract(5, 12)).to.eq(-7) }) it('can divide numbers', function () { expect(divide(27, 9)).to.eq(3) }) it('can muliple numbers', function () { expect(multiply(5, 4)).to.eq(20) }) }) })
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!