Skip to main content

wrapInTestApp()

Home > @backstage/test-utils > wrapInTestApp

Wraps a component inside a Backstage test app, providing a mocked theme and app context, along with mocked APIs.

Signature:

function wrapInTestApp(Component: ComponentType | ReactNode, options?: TestAppOptions): ReactElement;

Parameters

ParameterTypeDescription
ComponentComponentType | ReactNodeA component or react node to render inside the test app.
optionsTestAppOptions(Optional) Additional options for the rendering.

Returns:

ReactElement