mock-vue-router.ts 360 B

1234567891011121314
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. export const mockRouterHooks = () => {
  3. vi.mock('vue-router', async () => {
  4. const module =
  5. await vi.importActual<typeof import('vue-router')>('vue-router')
  6. return {
  7. ...module,
  8. onBeforeRouteUpdate: vi.fn(),
  9. onBeforeRouteLeave: vi.fn(),
  10. }
  11. })
  12. }