Skip to content

Commit

Permalink
chore: render render result interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Aug 7, 2024
1 parent be7934f commit 8c27760
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { beforeEach } from 'vitest'
import { cleanup, render } from './pure'

export { render, cleanup } from './pure'
export type { ComponentRenderOptions, Screen } from './pure'
export type { ComponentRenderOptions, RenderResult } from './pure'

page.extend({
render,
Expand Down
4 changes: 2 additions & 2 deletions src/pure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react'
import type { Container } from 'react-dom/client'
import ReactDOMClient from 'react-dom/client'

export interface Screen extends LocatorSelectors {
export interface RenderResult extends LocatorSelectors {
container: HTMLElement
baseElement: HTMLElement
debug: (
Expand Down Expand Up @@ -34,7 +34,7 @@ const mountedRootEntries: {
export function render(
ui: React.ReactNode,
{ container, baseElement, wrapper: WrapperComponent }: ComponentRenderOptions = {},
): Screen {
): RenderResult {
if (!baseElement) {
// default to document.body instead of documentElement to avoid output of potentially-large
// head elements (such as JSS style blocks) in debug output
Expand Down

0 comments on commit 8c27760

Please sign in to comment.