{"version":3,"file":"index.mjs","names":[],"sources":["../src/routeLocation.ts","../src/testers/jest.ts","../src/testers/sinon.ts","../src/testers/vitest.ts","../src/autoSpy.ts","../src/router.ts","../src/injections.ts","../src/plugin.ts"],"sourcesContent":["import { RouteLocationNormalizedLoaded } from 'vue-router'\nimport { computed, ComputedRef, reactive, Ref } from 'vue'\n\n/**\n * Wraps a `router.currentRoute` properties using `reactive` and computed\n * properties to mimic `useRoute()` from vue-router.\n *\n * @param route router.currentRoute to wrap\n */\nexport function createReactiveRouteLocation(\n  route: Ref<RouteLocationNormalizedLoaded>\n): RouteLocationNormalizedLoaded {\n  return reactive(\n    Object.keys(route.value).reduce(\n      (newRoute, key) => {\n        // @ts-ignore\n        newRoute[key] = computed(() => route.value[key])\n        return newRoute\n      },\n      {} as {\n        [k in keyof RouteLocationNormalizedLoaded]: ComputedRef<\n          RouteLocationNormalizedLoaded[k]\n        >\n      }\n    )\n  ) as RouteLocationNormalizedLoaded\n}\n","export function getJestGlobal() {\n  return typeof jest !== 'undefined' && jest\n}\n","import type { SinonStatic } from 'sinon'\n\ndeclare const sinon: SinonStatic | undefined\n\nexport function getSinonGlobal() {\n  return typeof sinon !== 'undefined' && sinon\n}\n","// cannot import the actual typ\ndeclare const vi: typeof jest\n\nexport function getVitestGlobal() {\n  return typeof vi !== 'undefined' && vi\n}\n","import { getJestGlobal } from './testers/jest'\nimport { getSinonGlobal } from './testers/sinon'\nimport { getVitestGlobal } from './testers/vitest'\n\n/**\n * Creates a spy on a function\n *\n * @param fn function to spy on\n * @returns [spy, mockClear]\n */\nexport function createSpy<Fn extends (...args: any[]) => any>(\n  fn: Fn,\n  spyFactory?: RouterMockSpyOptions\n): [_InferSpyType<Fn>, () => void] {\n  if (spyFactory) {\n    const spy = spyFactory.create(fn)\n    return [spy, () => spyFactory.reset(spy)]\n  }\n\n  const sinon = getSinonGlobal()\n  if (sinon) {\n    const spy = sinon.spy(fn)\n    return [spy as unknown as _InferSpyType<Fn>, () => spy.resetHistory()]\n  }\n\n  const jest = getVitestGlobal() || getJestGlobal()\n  if (jest) {\n    const spy = jest.fn(fn)\n    return [spy as unknown as _InferSpyType<Fn>, () => spy.mockClear()]\n  }\n\n  console.error(\n    `Couldn't detect a global spy (tried jest and sinon). Make sure to provide a \"spy.create\" option when creating the router mock.`\n  )\n  throw new Error(\n    'No Spy Available. See https://github.com/posva/vue-router-mock#testing-libraries'\n  )\n}\n\n/**\n * Options passed to the `spy` option of the `createRouterMock` function\n */\nexport interface RouterMockSpyOptions {\n  /**\n   * Creates a spy (for example, `create: fn => vi.fn(fn)` with vitest)\n   */\n  create: (...args: any[]) => any\n\n  /**\n   * Resets a spy but keeps it active.\n   */\n  reset: (spy: _InferSpyType) => void\n}\n\n/**\n * Define your own Spy to adapt to your testing framework (jest, peeky, sinon, vitest, etc)\n * @beta: still trying out, could change in the future\n *\n * @example\n * ```ts\n * import 'vue-router-mock' // Only needed on external d.ts files\n *\n * declare module 'vue-router-mock' {\n *   export interface RouterMockSpy<Fn> {\n *     spy: Sinon.Spy<Parameters<Fn>, ReturnType<Fn>>\n *   }\n * }\n * ```\n */\nexport interface RouterMockSpy<\n  Fn extends (...args: any[]) => any = (...args: any[]) => any,\n> {\n  // cannot be added or it wouldn't be extensible\n  // spy: any\n}\n\n/**\n * @internal\n */\nexport type _InferSpyType<\n  Fn extends (...args: any[]) => any = (...args: any[]) => any,\n  // @ts-ignore: the version with Record<'spy', any> doesn't work...\n> = keyof RouterMockSpy<Fn> extends 'spy' ? RouterMockSpy<Fn>['spy'] : Fn\n// > = RouterMockSpy<Fn> extends Record<'spy', any> ? RouterMockSpy<Fn>['spy'] : Fn\n","import { defineComponent, nextTick, ref } from 'vue'\nimport type { Ref } from 'vue'\nimport {\n  createMemoryHistory,\n  createRouter,\n  LocationQueryRaw,\n  RouteLocationNormalizedLoaded,\n  RouteLocationRaw,\n  RouteParamsRaw,\n  Router,\n  RouteRecordRaw,\n  RouterOptions,\n  START_LOCATION,\n} from 'vue-router'\nimport { createSpy, RouterMockSpyOptions, _InferSpyType } from './autoSpy'\n\nexport const EmptyView = defineComponent({\n  name: 'RouterMockEmptyView',\n  render: () => null,\n})\n\n/**\n * Router Mock instance\n */\nexport interface RouterMock extends Router {\n  /**\n   * Current depth of the router view. This index is used to find the component\n   * to display in the array `router.currentRoute.value.matched`.\n   */\n  depth: Ref<number>\n  /**\n   * Set a value to be returned on a navigation guard for the next navigation.\n   *\n   * @param returnValue - value that will be returned on a simulated navigation\n   * guard\n   */\n  setNextGuardReturn(\n    returnValue: Error | boolean | RouteLocationRaw | undefined\n  ): void\n\n  // NOTE: we could automatically wait for a tick inside getPendingNavigation(), that would require access to the wrapper, unless directly using nextTick from vue works. We could allow an optional parameter `eager: true` to not wait for a tick. Waiting one tick by default is likely to be more useful than not.\n\n  /**\n   * Returns a Promise of the pending navigation. Resolves right away if there\n   * isn't any.\n   */\n  getPendingNavigation(): ReturnType<Router['push']>\n\n  /**\n   * Sets the params of the current route without triggering a navigation. Can\n   * be awaited to wait for Vue to render again.\n   *\n   * @param params - params to set in the current route\n   */\n  setParams(params: RouteParamsRaw): Promise<void>\n\n  /**\n   * Sets the query of the current route without triggering a navigation. Can\n   * be awaited to wait for Vue to render again.\n   *\n   * @param query - query to set in the current route\n   */\n  setQuery(query: LocationQueryRaw): Promise<void>\n\n  /**\n   * Sets the hash of the current route without triggering a navigation. Can\n   * be awaited to wait for Vue to render again.\n   *\n   * @param hash - hash to set in the current route\n   */\n  setHash(hash: string): Promise<void>\n\n  /**\n   * Clear all the mocks and reset the location of the router. This is useful to be called in a `beforeEach()` test hook\n   * to reset the router state before each test.\n   */\n  reset(): void\n\n  push: _InferSpyType<Router['push']>\n  replace: _InferSpyType<Router['replace']>\n  // FIXME: it doesn't seem to work for overloads\n  // addRoute: _InferSpyType<Router['addRoute']>\n}\n\n/**\n * Options passed to `createRouterMock()`.\n */\nexport interface RouterMockOptions extends Partial<RouterOptions> {\n  /**\n   * Override the starting location before each test. Defaults to\n   * START_LOCATION.\n   */\n  initialLocation?: RouteLocationRaw\n\n  /**\n   * Run in-component guards. Defaults to false. Setting this to `true` will also run global guards as if\n   * `useRealNavigation` was set to `true`.\n   */\n  runInComponentGuards?: boolean\n\n  /**\n   * Runs all navigation through a `push()` or `replace()` to effectively run any global.\n   */\n  useRealNavigation?: boolean\n\n  /**\n   * Run per-route guards. Defaults to false.\n   * @deprecated use `removePerRouteGuards` instead\n   */\n  runPerRouteGuards?: boolean\n  /**\n   * Removes `beforeEnter` guards to any route added. Defaults to `true`.\n   */\n  removePerRouteGuards?: boolean\n\n  /**\n   * By default the mock will allow you to push to locations without adding all\n   * the necessary routes so you can still check if `router.push()` was called\n   * in a specific scenario\n   * (https://github.com/posva/vue-router-mock/issues/41). Set this to `true` to\n   * disable that behavior and throw when `router.push()` fails.\n   */\n  noUndeclaredRoutes?: boolean\n\n  /**\n   * By default the mock will use sinon, jest, or vitest support to create and reset spies. This option allows to use\n   * any testing library with its own spies, by providing a method to create spies, and one to reset them them. Check\n   * the `RouterMockSpy` type to add your own type.\n   *\n   * @example\n   *\n   * For example, with vitest with `globals: false`:\n   *\n   * ```ts\n   * const router = createRouterMock({\n   *   spy: {\n   *     create: fn => vi.fn(fn),\n   *     reset: spy => spy.mockClear()\n   *   }\n   * });\n   * ```\n   */\n  spy?: RouterMockSpyOptions\n}\n\n/**\n * Creates a router mock instance\n *\n * @param options - options to initialize the router\n */\nexport function createRouterMock(options: RouterMockOptions = {}): RouterMock {\n  const router = createRouter({\n    history: createMemoryHistory(),\n    routes: [\n      {\n        path: '/:pathMatch(.*)*',\n        component: EmptyView,\n      },\n    ],\n    ...options,\n  })\n\n  // add a default onError to avoid logging a warning\n  router.onError(() => {})\n\n  let {\n    runPerRouteGuards,\n    removePerRouteGuards,\n    runInComponentGuards,\n    useRealNavigation,\n    noUndeclaredRoutes,\n    spy,\n  } = options\n  const initialLocation = options.initialLocation || START_LOCATION\n\n  const { push, addRoute, replace, beforeEach, beforeResolve, onError } = router\n\n  const [addRouteMock, addRouteMockClear] = createSpy(\n    (\n      parentRecordName: Required<RouteRecordRaw>['name'] | RouteRecordRaw,\n      record?: RouteRecordRaw\n    ) => {\n      record = record || (parentRecordName as RouteRecordRaw)\n\n      if (!runPerRouteGuards || removePerRouteGuards) {\n        // remove existing records to force our own router.beforeEach and easier\n        // way to mock navigation guard returns.\n        delete record.beforeEnter\n      }\n\n      // @ts-ignore: this should be valid\n      return addRoute(parentRecordName, record)\n    },\n    spy\n  )\n\n  const [pushMock, pushMockClear] = createSpy((to: RouteLocationRaw) => {\n    return consumeNextReturn(to)\n  }, spy)\n\n  const [replaceMock, replaceMockClear] = createSpy((to: RouteLocationRaw) => {\n    return consumeNextReturn(to, { replace: true })\n  }, spy)\n\n  router.push = pushMock\n  router.replace = replaceMock\n  router.addRoute = addRouteMock\n\n  let guardRemovers: Array<() => void> = []\n  router.beforeEach = (...args) => {\n    const removeGuard = beforeEach(...args)\n    guardRemovers.push(removeGuard)\n    return removeGuard\n  }\n  router.beforeResolve = (...args) => {\n    const removeGuard = beforeResolve(...args)\n    guardRemovers.push(removeGuard)\n    return removeGuard\n  }\n  let onErrorRemovers: Array<() => void> = []\n  router.onError = (...args) => {\n    const removeOnError = onError(...args)\n    onErrorRemovers.push(removeOnError)\n    return removeOnError\n  }\n\n  function reset() {\n    pushMockClear()\n    replaceMockClear()\n    addRouteMockClear()\n\n    guardRemovers.forEach((remove) => remove())\n    guardRemovers = []\n\n    onErrorRemovers.forEach((remove) => remove())\n    onErrorRemovers = []\n\n    nextReturn = undefined\n    router.currentRoute.value =\n      initialLocation === START_LOCATION\n        ? START_LOCATION\n        : // technically\n          (router.resolve(initialLocation) as RouteLocationNormalizedLoaded)\n  }\n\n  let nextReturn: Error | boolean | RouteLocationRaw | undefined = undefined\n\n  function setNextGuardReturn(\n    returnValue: Error | boolean | RouteLocationRaw | undefined\n  ) {\n    nextReturn = returnValue\n  }\n\n  function consumeNextReturn(\n    to: RouteLocationRaw,\n    options: { replace?: boolean } = {}\n  ) {\n    if (nextReturn != null || runInComponentGuards || useRealNavigation) {\n      const removeGuard = router.beforeEach(() => {\n        const value = nextReturn\n        removeGuard()\n        nextReturn = undefined\n        return value\n      })\n\n      // avoid existing navigation guards\n      const record = router.currentRoute.value.matched[depth.value]\n      if (record && !runInComponentGuards) {\n        record.leaveGuards.clear()\n        record.updateGuards.clear()\n        Object.values(record.components || {}).forEach((component) => {\n          // TODO: handle promises?\n          // @ts-ignore\n          delete component.beforeRouteUpdate\n          // @ts-ignore\n          delete component.beforeRouteLeave\n        })\n      }\n\n      pendingNavigation = (options.replace ? replace : push)(to)\n      pendingNavigation\n        .catch(() => {})\n        .finally(() => {\n          pendingNavigation = undefined\n        })\n      return pendingNavigation\n    }\n\n    // we try to resolve the navigation\n    // but catch the error to simplify testing and avoid having to declare\n    // all the routes in the mock router\n    try {\n      // NOTE: should we trigger a push to reset the internal pending navigation of the router?\n      router.currentRoute.value = router.resolve(\n        to\n      ) as RouteLocationNormalizedLoaded\n    } catch (error) {\n      if (noUndeclaredRoutes) {\n        throw error\n      }\n    }\n    return Promise.resolve()\n  }\n\n  let pendingNavigation: ReturnType<typeof push> | undefined\n  function getPendingNavigation() {\n    return pendingNavigation || Promise.resolve()\n  }\n\n  // for all these functions we set the whole currentRoute to mimic router\n  // behavior: each navigation replaces the whole `currentRoute` object\n\n  function setParams(params: RouteParamsRaw) {\n    router.currentRoute.value = router.resolve({\n      params,\n    }) as RouteLocationNormalizedLoaded\n    return nextTick()\n  }\n\n  function setQuery(query: LocationQueryRaw) {\n    router.currentRoute.value = router.resolve({\n      query,\n    }) as RouteLocationNormalizedLoaded\n    return nextTick()\n  }\n\n  function setHash(hash: string) {\n    router.currentRoute.value = router.resolve({\n      hash,\n    }) as RouteLocationNormalizedLoaded\n    return nextTick()\n  }\n\n  const depth = ref(0)\n\n  // sets the initial location\n  reset()\n\n  return {\n    ...router,\n    push: pushMock,\n    replace: replaceMock,\n    addRoute: addRouteMock,\n    depth,\n    setNextGuardReturn,\n    getPendingNavigation,\n    setParams,\n    setQuery,\n    setHash,\n    reset,\n  }\n}\n","import {\n  matchedRouteKey,\n  routeLocationKey,\n  RouteLocationNormalizedLoaded,\n  routerKey,\n  RouterLink,\n  RouterView,\n  routerViewLocationKey,\n} from 'vue-router'\nimport { config } from '@vue/test-utils'\nimport { createReactiveRouteLocation } from './routeLocation'\nimport { createRouterMock, RouterMock } from './router'\nimport { computed, Plugin } from 'vue'\n\n/**\n * Inject global variables, overriding any previously inject router mock\n *\n * @param router - router mock to inject\n */\nexport function injectRouterMock(router?: RouterMock) {\n  router = router || createRouterMock()\n\n  const provides = createProvide(router)\n  const route = provides[\n    routeLocationKey as any\n  ] as RouteLocationNormalizedLoaded\n\n  Object.assign(config.global.provide, provides)\n\n  config.global.mocks.$router = router\n  config.global.mocks.$route = route\n\n  // TODO: stub that provides the prop route or the current route with matchedRouteKey\n  config.global.components.RouterView = RouterView\n  config.global.components.RouterLink = RouterLink\n\n  config.global.stubs.RouterLink = true\n  config.global.stubs.RouterView = true\n\n  return { router, route }\n}\n\n// TODO: explore this idea rather than having the weird inject function\nexport function createPlugin(router: RouterMock): Plugin {\n  return (app) => {\n    const provides = createProvide(router)\n    const route = provides[\n      routeLocationKey as any\n    ] as RouteLocationNormalizedLoaded\n\n    for (const key in provides) {\n      app.provide(key, provides[key])\n    }\n    app.config.globalProperties.$router = router\n    app.config.globalProperties.$route = route\n  }\n}\n\n/**\n * Creates an object of properties to be provided at your application level to\n * mock what is injected by vue-router\n *\n * @param router - router mock instance\n */\nexport function createProvide(router: RouterMock) {\n  const route = createReactiveRouteLocation(router.currentRoute)\n\n  const matchedRouteRef = computed(\n    () => router.currentRoute.value.matched[router.depth.value]\n  )\n\n  return {\n    [routerKey as any]: router,\n    [routeLocationKey as any]: route,\n    [routerViewLocationKey as any]: router.currentRoute,\n    [matchedRouteKey as any]: matchedRouteRef,\n  }\n}\n","import { config } from '@vue/test-utils'\nimport type { VueWrapper } from '@vue/test-utils'\nimport { routerKey } from 'vue-router'\nimport type { RouterMock } from './router'\n\nexport function plugin(\n  wrapper: VueWrapper\n  // options: Pick<\n  //   RouterOptions,\n  //   | 'end'\n  //   | 'sensitive'\n  //   | 'strict'\n  //   | 'linkActiveClass'\n  //   | 'linkExactActiveClass'\n  //   | 'parseQuery'\n  //   | 'stringifyQuery'\n  // > &\n  //   RouterMockOptions = {}\n) {\n  // if (!config.global.components.RouterView) {\n  //   const router = createRouterMock(options)\n  //   injectRouterMock(router)\n  // }\n\n  const router: RouterMock = getRouter()\n\n  // set all instances when installing the plugin\n  // TODO: WTF needs any at build\n  router.currentRoute.value.matched.forEach((record: any) => {\n    for (const name in record.components) {\n      record.instances[name] = wrapper.vm\n    }\n  })\n\n  wrapper.router = router\n\n  return wrapper\n}\n\nexport function getRouter() {\n  return config.global.provide[routerKey as any] as RouterMock\n}\n\ndeclare module '@vue/test-utils' {\n  interface VueWrapper<VM, T> {\n    router: RouterMock\n  }\n}\n"],"mappings":";;;;;;;;;;;AASA,SAAgB,4BACd,OAC+B;AAC/B,QAAO,SACL,OAAO,KAAK,MAAM,MAAM,CAAC,QACtB,UAAU,QAAQ;AAEjB,WAAS,OAAO,eAAe,MAAM,MAAM,KAAK;AAChD,SAAO;IAET,EAAE,CAKH,CACF;;;;;ACzBH,SAAgB,gBAAgB;AAC9B,QAAO,OAAO,SAAS,eAAe;;;;;ACGxC,SAAgB,iBAAiB;AAC/B,QAAO,OAAO,UAAU,eAAe;;;;;ACFzC,SAAgB,kBAAkB;AAChC,QAAO,OAAO,OAAO,eAAe;;;;;;;;;;;ACMtC,SAAgB,UACd,IACA,YACiC;AACjC,KAAI,YAAY;EACd,MAAM,MAAM,WAAW,OAAO,GAAG;AACjC,SAAO,CAAC,WAAW,WAAW,MAAM,IAAI,CAAC;;CAG3C,MAAM,QAAQ,gBAAgB;AAC9B,KAAI,OAAO;EACT,MAAM,MAAM,MAAM,IAAI,GAAG;AACzB,SAAO,CAAC,WAA2C,IAAI,cAAc,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