You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Front-end: Investigate unit tests for NextJS pages #74
On the front-end, we currently have quite a bit of code coverage, but there is one spot that is currently difficult to test.
The /pages directory has special properties in NextJS:
Every file in there is pulled in as a top-level route
There is some ambient context in the form of routes
We'll have to revisit our testing approach for these files. For pages, we'll likely need a separate directory so that the tests don't get included in the bundle or as routes (there may be a way to configure next for this).
It's possible we can just directly import them and run them, however, we may need to investigate using a library like next-page-tester.
Activity
bryphe-coder commentedon Jan 26, 2022
Looks like we can change the extensions for our pages to filter out the test files, to address the first bullet point: https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions#including-non-page-files-in-the-pages-directory
misskniss commentedon Mar 28, 2022
@vapurrmaid do we still need this issue with the work to move off Next recently? If not will you close it?