Skip to main content

Function: createRenderedLegacyTestEngine()

createRenderedLegacyTestEngine<T>(rootElement, partDefinitions, _option?): TestEngine<T>

Defined in: react/src/createLegacyTestEngine.ts:65

Create test engine for React 17 or before, for React 18 or later, use createRenderedTestEngine This function takes an html element purportedly rendered by React and create a test engine for it, it can be useful in environment such as Storybook where Storybook renders the component and the test

Type Parameters

T

T extends ScenePart

Parameters

rootElement

HTMLElement

The React node to render

partDefinitions

T

The scene part definitions

_option?

Readonly<Partial<IReactTestEngineOption>>

Returns

TestEngine<T>

The test engine