Skip to content

Commit

Permalink
test: handle new error in React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
thebuilder committed Jun 8, 2024
1 parent 88b5d75 commit 766d27b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ jobs:
run: |
pnpm add -D react@${{ matrix.react }} react-dom@${{ matrix.react }}
pnpm test
pnpm tsc
8 changes: 2 additions & 6 deletions src/__tests__/InView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ test("should render with fallback", () => {
render(<InView onChange={cb}>Inner</InView>);
// @ts-ignore
console.error.mockRestore();
}).toThrowErrorMatchingInlineSnapshot(
`[TypeError: IntersectionObserver is not a constructor]`,
);
}).toThrow();
});

test("should render with global fallback", () => {
Expand All @@ -215,7 +213,5 @@ test("should render with global fallback", () => {
render(<InView onChange={cb}>Inner</InView>);
// @ts-ignore
console.error.mockRestore();
}).toThrowErrorMatchingInlineSnapshot(
`[TypeError: IntersectionObserver is not a constructor]`,
);
}).toThrow();
});

0 comments on commit 766d27b

Please sign in to comment.