Skip to content

Commit

Permalink
patch window.scrollTo in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance committed Dec 16, 2022
1 parent af262d0 commit 16d913e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/remix-react/__tests__/scroll-restoration-test.tsx
Expand Up @@ -20,10 +20,12 @@ function AppShell({ children }: { children: React.ReactNode }) {
}

describe("<ScrollRestoration />", () => {
let scrollTo = window.scrollTo;
beforeAll(() => {
if (!window.scrollTo) {
window.scrollTo = () => {};
}
window.scrollTo = () => {};
});
afterAll(() => {
window.scrollTo = scrollTo;
});
function withContext(stuff: JSX.Element) {
let context: RemixEntryContextType = {
Expand Down

0 comments on commit 16d913e

Please sign in to comment.