Next.js Discord

Discord Forum

How to test the main App component?

Unanswered
Golden northern bumble bee posted this in #help-forum
Open in Discord
Golden northern bumble beeOP
I can't find any example on how to test the App main component. When I just import App from src/pages/__app.ts it demands to pass router and I don't know where to get one. Is there a way to test the whole app? For example I need to see that there were no RED CONSOLE.

4 Replies

Golden northern bumble beeOP
Error was:
Property 'router' is missing in type '{ Component: () => Element; pageProps: {}; }' but required in type '{ Component: NextComponentType<NextPageContext, any, any>; router: Router; __N_SSG?: boolean | undefined; __N_SSP?: boolean | undefined; }'.ts(2741)
utils.d.ts(148, 5): 'router' is declared here.
What is the blueprint for App testing?
Actually, I need to test my pages, not App.