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

159
Vistas
How to write a regular expression test with a message in jasmine

I started using Jasmine. I want to test a validation function but I don't know how to do it.

I wrote the first case. How can I get a message in the event of an error?

Any help will be important to me.

describe('First test, function() {  
 it('First case', function() {
  expect({login: 'first_user'}).toEqual({login: jasmine.stringMatching(/^[A-Za-z-ĘÓŁŚĄŻŹĆŃęółśążźćń0-9.\-_ /]+$/)});
  expect({haslo: 'FirstUser!1'}).toEqual({haslo: jasmine.stringMatching(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/)});
 })
}) 

about 4 years ago · Juan Pablo Isaza
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