import { ReactElement } from 'react' ; import { TestingAdaptor , TestingAdaptorInstance } from './adaptor' ; import { ElementNode } from '../../reconciler/instance' ; export class RenderResult { public constructor ( private adaptorInstance ) { } public getContainer = ( ) : ElementNode => this . adaptorInstance . data ; public getByText = ( ) => { } ; public queryByText = ( ) => { } ; public findByText = ( ) => { } ; public resolveUpdateCallback = ( renderId ? ) => this . adaptorInstance . resolveUpdateCallback ( renderId ) ; public setManuallyResolvedUpdateCallback = ( enabled ) => { this . adaptorInstance . setManuallyResolvedUpdateCallback ( enabled ) ; } ; } export const render = ( rootElement ) => { const testingAdaptor = new TestingAdaptor ( ) ; const testingAdaptorInstance = testingAdaptor . run ( rootElement ) ; return new RenderResult ( testingAdaptorInstance ) ; } ;