Skip to content

Commit bdc83d8

Browse files
authored
add return type to withinDOM implementation (#11802)
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)
1 parent 2901c1e commit bdc83d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/testing/internal/profile/Render.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class RenderInstance<Snapshot> implements Render<Snapshot> {
124124
return (this._domSnapshot = body);
125125
}
126126

127-
get withinDOM() {
127+
get withinDOM(): () => SyncScreen {
128128
const snapScreen = Object.assign(within(this.domSnapshot), {
129129
debug: (
130130
...[dom = this.domSnapshot, ...rest]: Parameters<typeof screen.debug>

0 commit comments

Comments
 (0)