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
chore: convert Jest examples to TypeScript (#32705)
* chore: convert Jest examples to TypeScript
* test: use absolute imports in test files
* chore: address review comments
* fix: add pages to tsconfig.json paths
* fix: add styles to tsconfig.json paths
* chore: upgrade dependencies/snapshots
* docs: match Testing docs with example code
* docs: link to docs from mock test files
Co-authored-by: Lee Robinson <me@leerob.io>
> **Note**: The `@jest-environment jsdom` comment above configures the testing environment as `jsdom` inside the test file because React Testing Library uses DOM elements like `document.body` which will not work in Jest's default `node` testing environment. Alternatively, you can also set the `jsdom` environment globally by adding the Jest configuration option: `"testEnvironment": "jsdom"` in `jest.config.js`.
460
-
461
-
Optionally, add a [snapshot test](https://jestjs.io/docs/snapshot-testing) to keep track of any unexpected changes to your `<Index />` component:
456
+
Optionally, add a [snapshot test](https://jestjs.io/docs/snapshot-testing) to keep track of any unexpected changes to your `<Home />` component:
Copy file name to clipboardExpand all lines: examples/with-jest-babel/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This example shows how to configure Jest to work with Next.js and Babel. Since the release of Next.js 12, Next.js has in-built configuration for Jest with SWC. See the [with-jest](https://github.com/vercel/next.js/tree/canary/examples/with-jest) example for the latest implementation.
4
4
5
-
This includes Next.js' built-in support for Global CSS, CSS Modules, and TypeScript!
5
+
This includes Next.js' built-in support for Global CSS, CSS Modules and TypeScript.
0 commit comments