Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda