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

258
Views
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
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!