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

254
Vistas
Can not mock $route and $roter for jest unit tests

I have question. I have unit test and I want to mock $route and $router According docs I must not use localVue.use(VueRouter) So I did not used it. But then I apply unit test it is not working "compiler# throws error image

I mocked components what are used in TeamCalendarCard(see pic1) but still by some means router is added to unit test.

I checked i do not add anywhere else in unit test localVue.use(VueRouter)

Full code could be find here

The imports and other stuff for unit tests to work imports of unit tests The unit test in question unit test what rises error

So what have I tried remove localVue.use(Route) according docs and answered questions in stackoverflow

Any suggestions how to mock route or wouldbe better tool/aproach to where search in code where localVue.use(Route) is added.

about 4 years ago · Santiago Gelvez
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