Skip to content

Commit

Permalink
add return type to withinDOM implementation
Browse files Browse the repository at this point in the history
to prevent
> The inferred type of 'withinDOM' cannot be named without a reference to '@testing-library/dom/node_modules/pretty-format'. This is likely not portable. A type annotation is necessary.ts(2742)
  • Loading branch information
phryneas committed Apr 23, 2024
1 parent a4c89f0 commit c051531
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/testing/internal/profile/Render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class RenderInstance<Snapshot> implements Render<Snapshot> {
return (this._domSnapshot = body);
}

get withinDOM() {
get withinDOM(): () => SyncScreen {
const snapScreen = Object.assign(within(this.domSnapshot), {
debug: (
...[dom = this.domSnapshot, ...rest]: Parameters<typeof screen.debug>
Expand Down

0 comments on commit c051531

Please sign in to comment.