Backstage
    Preparing search index...
    • Fake implementation of @backstage/frontend-plugin-api#AppHistoryApi.

      Parameters

      • Optionaloptions: {
            basename?: string;
            initialLocation?: string;
            navigate?: Mock<any, any, any> | AppNavigate;
        }
        • Optionalbasename?: string

          App deploy basename prefixed onto createHref results, mirroring the real AppHistoryApi implementation — including leaving targets that are not app-relative alone, and stripping the prefix back off initialLocation.

          navigate targets and snapshot locations are app-relative on both sides of the basename, exactly as in production: the real implementation prepends the basename on the way into the History API and strips it on the way back out, so a round trip through it is invisible.

        • OptionalinitialLocation?: string

          Initial location for the mock app history's snapshot. Defaults to '/'.

          Stands in for the browser URL, so a basename is stripped from it just as the real app history strips it from window.location — every location the API then hands out is app-relative.

        • Optionalnavigate?: Mock<any, any, any> | AppNavigate

          Optional jest mock (or function) invoked by navigate. Location emission still happens before this is called.

      Returns AppHistoryApi & {
          navigateCalls: {
              options?: { replace?: boolean; state?: unknown };
              to: string | number;
          }[];
      } & {
          "[mockApiFactorySymbol]": ApiFactory<AppHistoryApi, AppHistoryApi, {}>;
      }

      • navigateCalls: { options?: { replace?: boolean; state?: unknown }; to: string | number }[]

        Recorded navigation calls, in order.