I gave a presentation at the SagLacIO on how to setup jest testing in NextJS and deploy with Vercel.
The following project was created as part of this presentation:
The files you should be interested in:
package.json: package versions and commands
setupTests.js: The config used by
npm run test(aka
tests/index.test.js: The test being executed
.gitlab-ci.yml: The file telling gitlab-ci to run the build and the tests
Thanks to @m0xx for pointing this out; Use NextJS examples directly instead:
npx create-next-app --example with-jest with-jest-app
If you have suggestions, feel free to poke me or open an issue.