Closed kgajera closed 3 years ago
This upgrades to the latest major version of jest in the template and for the CLI. They have changed the default testEnvironment configuration value.
testEnvironment
All test files that rely on DOM, now include the following comment specifying the environment to use:
/** * @jest-environment jsdom */
From jest docs: https://jestjs.io/blog/2021/05/25/jest-27#flipping-defaults
For mixed projects where some tests require a DOM environment but others don't, we recommend using the fast "node" environment by default and declaring exactly those tests that need the DOM using docblocks.
Next.js's docs suggest doing the same: https://nextjs.org/docs/testing
Fixes #207
Changes
This upgrades to the latest major version of jest in the template and for the CLI. They have changed the default
testEnvironment
configuration value.All test files that rely on DOM, now include the following comment specifying the environment to use:
From jest docs: https://jestjs.io/blog/2021/05/25/jest-27#flipping-defaults
Next.js's docs suggest doing the same: https://nextjs.org/docs/testing
Checklist
Fixes #207