Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@backstage/frontend-test-utils

backstage294.5kApache-2.00.3.2TypeScript support: included

null

readme

headline

Backstage

English | 한국어 | 中文版 | Français

License CNCF Status Discord Code style Codecov OpenSSF Best Practices OpenSSF Scorecard

What is Backstage?

Backstage is an open source framework for building developer portals. Powered by a centralized software catalog, Backstage restores order to your microservices and infrastructure and enables your product teams to ship high-quality code quickly without compromising autonomy.

Backstage unifies all your infrastructure tooling, services, and documentation to create a streamlined development environment from end to end.

software-catalog

Out of the box, Backstage includes:

  • Backstage Software Catalog for managing all your software such as microservices, libraries, data pipelines, websites, and ML models
  • Backstage Software Templates for quickly spinning up new projects and standardizing your tooling with your organization’s best practices
  • Backstage TechDocs for making it easy to create, maintain, find, and use technical documentation, using a "docs like code" approach
  • Plus, a growing ecosystem of open source plugins that further expand Backstage’s customizability and functionality

Backstage was created by Spotify but is now hosted by the Cloud Native Computing Foundation (CNCF) as an Incubation level project. For more information, see the announcement.

Project roadmap

For information about the detailed project roadmap including delivered milestones, see the Roadmap.

Getting Started

To start using Backstage, see the Getting Started documentation.

Documentation

The documentation of Backstage includes:

Community

To engage with our community, you can use the following resources:

Governance

See the GOVERNANCE.md document in the backstage/community repository.

License

Copyright 2020-2025 © The Backstage Authors. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page: https://www.linuxfoundation.org/trademark-usage

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Security

Please report sensitive security issues using Spotify's bug-bounty program rather than GitHub.

For further details, see our complete security release process.

changelog

@backstage/frontend-test-utils

0.3.2

Patch Changes

0.3.2-next.3

Patch Changes

0.3.2-next.2

Patch Changes

0.3.2-next.1

Patch Changes

0.3.2-next.0

Patch Changes

0.3.1

Patch Changes

0.3.1-next.1

Patch Changes

0.3.1-next.0

Patch Changes

0.3.0

Minor Changes

  • bba525b: BREAKING: Removed deprecated setupRequestMockHandlers which was replaced by registerMswTestHooks.

Patch Changes

0.3.0-next.2

Minor Changes

  • bba525b: BREAKING: Removed deprecated setupRequestMockHandlers which was replaced by registerMswTestHooks.

Patch Changes

0.2.7-next.1

Patch Changes

0.2.7-next.0

Patch Changes

0.2.6

Patch Changes

0.2.6-next.3

Patch Changes

0.2.6-next.2

Patch Changes

0.2.6-next.1

Patch Changes

0.2.6-next.0

Patch Changes

0.2.5

Patch Changes

0.2.5-next.0

Patch Changes

0.2.4

Patch Changes

0.2.4-next.2

Patch Changes

0.2.4-next.1

Patch Changes

0.2.4-next.0

Patch Changes

0.2.2

Patch Changes

0.2.2-next.2

Patch Changes

0.2.2-next.1

Patch Changes

0.2.2-next.0

Patch Changes

0.2.1

Patch Changes

  • 666d5b1: Disable the built-in SignInPage in createExtensionTester in order to not mess with existing tests
  • e969dc7: Move @types/react to a peer dependency.
  • 873e424: Internal refactor of usage of opaque types.
  • 0801db6: Added an ApiMock, analogous to ServiceMock from the backend test utils.
  • 9cc7dd6: Added a mockApis export, which will replace the MockX API implementation classes and their related types. This is analogous with the backend's mockServices.

    DEPRECATED several old helpers:

    • Deprecated MockAnalyticsApi, please use mockApis.analytics instead.
    • Deprecated MockConfigApi, please use mockApis.config instead.
    • Deprecated MockPermissionApi, please use mockApis.permission instead.
    • Deprecated MockStorageApi, please use mockApis.storage instead.
    • Deprecated MockTranslationApi, please use mockApis.translation instead.
  • Updated dependencies

0.2.1-next.2

Patch Changes

0.2.1-next.1

Patch Changes

0.2.1-next.0

Patch Changes

0.2.0

Minor Changes

  • 5446061: Removed support for testing "v1" extensions, where outputs are defined as an object rather than an array.
  • e6e488c: BREAKING: The deprecated .render() method has been removed from the extension tester.

Patch Changes

0.2.0-next.2

Patch Changes

0.2.0-next.1

Patch Changes

0.2.0-next.0

Minor Changes

  • 5446061: Removed support for testing "v1" extensions, where outputs are defined as an object rather than an array.
  • e6e488c: BREAKING: The deprecated .render() method has been removed from the extension tester.

Patch Changes

0.1.12

Patch Changes

  • 8209449: Added new APIs for testing extensions
  • 72754db: Updated usage of useRouteRef, which can now always return undefined.
  • 3be9aeb: Added support for v2 extensions, which declare their inputs and outputs without using a data map.
  • fe1fbb2: Migrating usages of the deprecated createExtension v1 format to the newer v2 format, and old create*Extension extension creators to blueprints.
  • 2d21599: Added support for being able to override extension definitions.

    const TestCard = EntityCardBlueprint.make({
      ...
    });
    
    TestCard.override({
      // override attachment points
      attachTo: { id: 'something-else', input: 'overridden' },
      // extend the config schema
      config: {
        schema: {
          newConfig: z => z.string().optional(),
        }
      },
      // override factory
      *factory(originalFactory, { inputs, config }){
        const originalOutput = originalFactory();
    
        yield coreExentsionData.reactElement(
          <Wrapping>
            {originalOutput.get(coreExentsionData.reactElement)}
          </Wrapping>
        );
      }
    });
    
  • c00e1a0: Deprecate the .render method of the createExtensionTester in favour of using renderInTestApp directly.

    import {
      renderInTestApp,
      createExtensionTester,
    } from '@backstage/frontend-test-utils';
    
    const tester = createExtensionTester(extension);
    
    const { getByTestId } = renderInTestApp(tester.reactElement());
    
    // or if you're not using `coreExtensionData.reactElement` as the output ref
    const { getByTestId } = renderInTestApp(tester.get(myComponentRef));
  • 264e10f: Deprecate existing ExtensionCreators in favour of their new Blueprint counterparts.

  • 264e10f: Refactor .make method on Blueprints into two different methods, .make and .makeWithOverrides.

    When using createExtensionBlueprint you can define parameters for the factory function, if you wish to take advantage of these parameters you should use .make when creating an extension instance of a Blueprint. If you wish to override more things other than the standard attachTo, name, namespace then you should use .makeWithOverrides instead.

    .make is reserved for simple creation of extension instances from Blueprints using higher level parameters, whereas .makeWithOverrides is lower level and you have more control over the final extension.

  • 6349099: Added config input type to the extensions

  • Updated dependencies

0.1.12-next.3

Patch Changes

  • 2d21599: Added support for being able to override extension definitions.

    const TestCard = EntityCardBlueprint.make({
      ...
    });
    
    TestCard.override({
      // override attachment points
      attachTo: { id: 'something-else', input: 'overridden' },
      // extend the config schema
      config: {
        schema: {
          newConfig: z => z.string().optional(),
        }
      },
      // override factory
      *factory(originalFactory, { inputs, config }){
        const originalOutput = originalFactory();
    
        yield coreExentsionData.reactElement(
          <Wrapping>
            {originalOutput.get(coreExentsionData.reactElement)}
          </Wrapping>
        );
      }
    });
    
  • 264e10f: Deprecate existing ExtensionCreators in favour of their new Blueprint counterparts.

  • 264e10f: Refactor .make method on Blueprints into two different methods, .make and .makeWithOverrides.

    When using createExtensionBlueprint you can define parameters for the factory function, if you wish to take advantage of these parameters you should use .make when creating an extension instance of a Blueprint. If you wish to override more things other than the standard attachTo, name, namespace then you should use .makeWithOverrides instead.

    .make is reserved for simple creation of extension instances from Blueprints using higher level parameters, whereas .makeWithOverrides is lower level and you have more control over the final extension.

  • Updated dependencies

0.1.12-next.2

Patch Changes

0.1.12-next.1

Patch Changes

0.1.11-next.0

Patch Changes

0.1.10

Patch Changes

0.1.10-next.2

Patch Changes

0.1.10-next.1

Patch Changes

0.1.9-next.0

Patch Changes

0.1.8

Patch Changes

0.1.8-next.2

Patch Changes

0.1.8-next.1

Patch Changes

0.1.8-next.0

Patch Changes

0.1.7

Patch Changes

0.1.7-next.2

Patch Changes

0.1.7-next.1

Patch Changes

0.1.7-next.0

Patch Changes

0.1.6

Patch Changes

0.1.6-next.1

Patch Changes

0.1.6-next.0

Patch Changes

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.3-next.2

Patch Changes

0.1.3-next.1

Patch Changes

0.1.3-next.0

Patch Changes

0.1.2

Patch Changes

0.1.2-next.3

Patch Changes

0.1.2-next.2

Patch Changes

0.1.2-next.1

Patch Changes

0.1.2-next.0

Patch Changes

0.1.1

Patch Changes

  • f7566f9: Updates to reflect the app/router extension having been renamed to app/root.
  • 516fd3e: Updated README to reflect release status
  • c97fa1c: Added elements, wrappers, and router inputs to app/root, that let you add things to the root of the React tree above the layout. You can use the createAppRootElementExtension, createAppRootWrapperExtension, and createRouterExtension extension creator, respectively, to conveniently create such extensions. These are all optional, and if you do not supply a router a default one will be used (BrowserRouter in regular runs, MemoryRouter in tests/CI).
  • Updated dependencies

0.1.1-next.2

Patch Changes

0.1.1-next.1

Patch Changes

0.1.1-next.0

Patch Changes

0.1.0

Minor Changes

  • 59fabd5: New testing utility library for @backstage/frontend-app-api and @backstage/frontend-plugin-api.
  • af7bc3e: Switched all core extensions to instead use the namespace 'app'.

Patch Changes

  • 59fabd5: Added createExtensionTester for rendering extensions in tests.
  • 7e4b0db: The createExtensionTester helper is now able to render more than one route in the test app.
  • 818eea4: Updates for compatibility with the new extension IDs.
  • b9aa6e4: Migrate renderInTestApp to @backstage/frontend-test-utils for testing individual React components in an app.
  • e539735: Updates for core.router addition.
  • c21c9cf: Re-export mock API implementations as well as TestApiProvider, TestApiRegistry, withLogCollector, and setupRequestMockHandlers from @backstage/test-utils.
  • Updated dependencies

0.1.0-next.3

Patch Changes

0.1.0-next.2

Patch Changes

0.1.0-next.1

Patch Changes

0.1.0-next.0

Minor Changes

  • 59fabd5106: New testing utility library for @backstage/frontend-app-api and @backstage/frontend-plugin-api.

Patch Changes