Backstage
    Preparing search index...

    The TestApiRegistry is an @backstage/core-plugin-api#ApiHolder implementation that is particularly well suited for development and test environments such as unit tests, storybooks, and isolated plugin development setups.

    Implements

    Index

    Methods

    Methods

    • Creates a new TestApiRegistry with a list of API implementation pairs.

      Similar to the TestApiProvider, there is no need to provide a full implementation of each API, it's enough to implement the methods that are tested.

      Type Parameters

      • TApiPairs extends any[]

      Parameters

      • ...apis: readonly [TestApiProviderPropsApiPairs<TApiPairs>]

        A list of pairs mapping an ApiRef to its respective implementation.

      Returns TestApiRegistry

      const apis = TestApiRegistry.from(
      [configApiRef, new ConfigReader({})],
      [identityApiRef, { getUserId: () => 'tester' }],
      );