{"library":"vue-router-mock","type":"library","category":null,"description":"vue-router-mock is a testing utility designed for Vue 3 applications, specifically to facilitate unit and integration testing of components that interact with the official `vue-router`. Currently stable at version 2.0.2, the library maintains an active release cadence, providing minor updates for bug fixes and compatibility, such as the recent addition of `vue-router` v5 support. Its core purpose is to provide a mock `vue-router` instance that can be injected into components, enabling developers to spy on navigation calls (e.g., `push`, `replace`), simulate route changes, and assert router state without requiring a full browser environment or actual navigation. It differentiates itself from end-to-end testing tools by focusing on isolated scenarios, leading to more granular and faster test execution. The library integrates seamlessly with `@vue/test-utils` and offers flexible setup options for test environments like Jest or Vitest through functions such as `createRouterMock` and `injectRouterMock`.","language":"javascript","status":"active","version":"2.0.2","tags":["javascript","vue","router","mock","spy","stub","jest","test","vue-router","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install vue-router-mock","imports":["import { createRouterMock } from 'vue-router-mock'","import { injectRouterMock } from 'vue-router-mock'","import { VueRouterMock } from 'vue-router-mock'"]},{"cmd":"yarn add vue-router-mock","imports":[]},{"cmd":"pnpm add vue-router-mock","imports":[]}],"homepage":null,"github":"https://github.com/posva/vue-router-mock","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vue-router-mock","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/vue-router-mock/compatibility"}}