Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

328
Vistas
Test the new Error() message with Cypress

I went over the documentation of cypress and i did not find any details about how to test if a error was thrown in javascript like:
throw new Error('my error');
Question: Is there a solution to test if a error wast thrown like i showed above, or to test the message?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Such an error is an Uncaught exception from your application

When Cypress detects an uncaught exception in your application, it will fail the currently running test.

You can turn off this behavior globally or conditionally with the uncaught:exception event. Please see the Catalog of Events for examples.

Cypress.on('uncaught:exception', (err, runnable) => {
  expect(err.message).to.eq('my error')
  return false
})
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda