Skip to main content
Version: Next

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

Parameter

Type

Description

Component

ComponentType | ReactNode

A component or react node to render inside the test app.

options

TestAppOptions

(Optional) Additional options for the rendering.

**Returns:**

ReactElement