(ui: ReactElement, options: S2RenderOptions = {})
| 27 | * Uses vitest-browser-react for browser mode testing. |
| 28 | */ |
| 29 | export async function render(ui: ReactElement, options: S2RenderOptions = {}) { |
| 30 | const {providerOptions = {}} = options; |
| 31 | const {locale = 'en-US', colorScheme = 'light', ...restProviderOptions} = providerOptions; |
| 32 | |
| 33 | function Wrapper({children}: {children: React.ReactNode}) { |
| 34 | return ( |
| 35 | <Provider locale={locale} colorScheme={colorScheme} {...restProviderOptions}> |
| 36 | {children} |
| 37 | </Provider> |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | return await vitestBrowserRender(<Wrapper>{ui}</Wrapper>); |
| 42 | } |
no outgoing calls