Configures SWC transforms, mocks style and image imports, and loads your
.env filesnext/jest sets up Jest to understand a Next.js project. It configures SWC transforms, mocks style and image imports, and loads your .env files. So your code compiles and asset imports don't break tests. The tempting option that it mocks next/navigation is wrong. You still mock router hooks yourself. The option about async Server Components is wrong too. They remain an E2E concern.
Read more