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

Follow the breaking change of jest-config #26082

Merged

Conversation

toyamarinyon
Copy link
Contributor

@toyamarinyon toyamarinyon commented Jun 14, 2021

Documentation / Examples

When I create a new application using Next.js and use jest or react-testing-library, I get the following error.

The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
    Consider using the "jsdom" test environment.
    
    ReferenceError: document is not defined

This is because jest-config changed the default testing environment to node in 27.0.

jest-config@27.0.0 default to Node testing environment instead of browser (JSDOM) (#9874)

Raised the jest version of with-typescript-eslint-jest to 27.0 to make it pass the test.

  • Make sure the linting passes

@ijjk ijjk added the examples Issue/PR related to examples label Jun 14, 2021
@toyamarinyon toyamarinyon force-pushed the follow-the-breakingchage-of-jest-config branch from e24208c to dea07c4 Compare June 16, 2021 06:54
leerob
leerob previously approved these changes Jun 16, 2021
@kodiakhq kodiakhq bot merged commit fac02d8 into vercel:canary Jun 16, 2021
@toyamarinyon toyamarinyon deleted the follow-the-breakingchage-of-jest-config branch June 17, 2021 03:11
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Jun 24, 2021
## Documentation / Examples

When I create a new application using Next.js and use `jest` or `react-testing-library`, I get the following error.
```
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
    Consider using the "jsdom" test environment.
    
    ReferenceError: document is not defined
```
This is because `jest-config` changed the default testing environment to node in 27.0.
> `jest-config@27.0.0` default to Node testing environment instead of browser (JSDOM) (vercel#9874)


Raised the jest version of `with-typescript-eslint-jest` to 27.0 to make it pass the test.

- [x] Make sure the linting passes
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants