Skip to content

Commit

Permalink
chore: rename 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 132b17f commit 944d5af
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"vue": "^3.0.0"
},
"dependencies": {
"@vitest/pretty-format": "^2.1.0-beta.4",
"@vue/test-utils": "^2.4.6"
},
"devDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 @@ -10,7 +10,7 @@ type ComponentProps<T> = T extends new (...angs: any) => {

const mountedWrappers = new Set<VueWrapper>()

export interface Screen<Props> extends LocatorSelectors {
export interface RenderResult<Props> extends LocatorSelectors {
container: HTMLElement
baseElement: HTMLElement
debug(el?: HTMLElement | HTMLElement[] | Locator | Locator[], maxLength?: number, options?: PrettyDOMOptions): void
Expand All @@ -36,7 +36,7 @@ export function render<T, C = T extends ((...args: any) => any) | (new (...args:
baseElement: customBaseElement,
...mountOptions
}: ComponentRenderOptions<C, P> = {},
): Screen<P> {
): RenderResult<P> {
const div = document.createElement('div')
const baseElement = customBaseElement || customContainer || document.body
const container = customContainer || baseElement.appendChild(div)
Expand Down

0 comments on commit 944d5af

Please sign in to comment.