Skip to main content

Function: createRenderedTestEngine()

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

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

Create test engine for React 18 or later, for React 17 or before, use createRenderedLegacyTestEngine 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