Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme in nextjs testing #54322

Merged
merged 5 commits into from
Aug 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,11 @@ setupFilesAfterEnv: ['<rootDir>/jest.setup.js']
Then, inside `jest.setup.js`, add the following import:
manovotny marked this conversation as resolved.
Show resolved Hide resolved

```js filename="jest.setup.js"
manovotny marked this conversation as resolved.
Show resolved Hide resolved
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom'
```
manovotny marked this conversation as resolved.
Show resolved Hide resolved

manovotny marked this conversation as resolved.
Show resolved Hide resolved
> [`extend-expect` was removed in `v6.0`](https://github.com/testing-library/jest-dom/releases/tag/v6.0.0), so if you are using `@testing-library/jest-dom` before version 6, you will need to import `@testing-library/jest-dom/extend-expect` instead.

If you need to add more setup options before each test, it's common to add them to the `jest.setup.js` file above.

**Optional: Absolute Imports and Module Path Aliases**
Expand Down