Refactor to external scraper and update dependencies (#113)

This commit is contained in:
David
2022-06-15 23:37:15 +02:00
committed by GitHub
parent ff1ad202ae
commit 274e7f1a4b
49 changed files with 6952 additions and 4414 deletions

31
mocks/next.tsx Normal file
View File

@@ -0,0 +1,31 @@
import { FC, PropsWithChildren } from "react";
import { RouterContext } from "next/dist/shared/lib/router-context";
export const routerMock = {
basePath: "",
pathname: "/",
route: "/",
asPath: "/",
query: {},
push: jest.fn().mockResolvedValue(true),
replace: jest.fn().mockResolvedValue(true),
reload: jest.fn(),
back: jest.fn(),
prefetch: jest.fn().mockResolvedValue(undefined),
beforePopState: jest.fn(),
events: {
on: jest.fn(),
off: jest.fn(),
emit: jest.fn(),
},
isFallback: false,
isLocaleDomain: false,
isReady: false,
isPreview: false
};
export const RouterProviderMock: FC<PropsWithChildren> = ({ children }) => (
<RouterContext.Provider value={routerMock}>
{children}
</RouterContext.Provider>
);