-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
jest v28 environment error #36842
Comments
Ah, I recall setting this up last week, following this guide: https://jestjs.io/docs/upgrading-to-jest28#jsdom - will give it a go again, but I think there's no way around not installing If you are using JSDOM [test environment](https://jestjs.io/docs/configuration#testenvironment-string), jest-environment-jsdom package now must be installed separately:
npm install --save-dev jest-environment-jsdom
|
Well, it's a sub-package to jest, https://github.com/facebook/jest/tree/main/packages/jest-environment-jsdom, I believe it can be trusted, and installing it does fix the issue. Jest stopped shipping it bundled, and now wants you install it explicitly. |
All of this is not very obvious to a person stumbling upon |
Yeah, that's something to take up with the Jest team I guess. They have gone through some rough times, and only yesterday, it was announced that they'll be moving into the OpenJS foundation. There's also a few other migration pain points, such as file transforms, which do not work like they used to, and in my opinion the upgrade guide is a bit foggy on how to update those. I do think that the Last but not least, at least, the situation is way better than 5 years ago, oh boy, back then it was severe. |
The docs should already be updated in #36632, but it won't show up on the documentation page before our next stable release. I'll make sure to update our |
Ref: #36842, #36632, #36787 Upgrading to Jest 28, and aligning Babel example with `with-jest` ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System:
Binaries:
Relevant packages:
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
With
jest
of version 28+npm run test
ends in this error:● Validation Error: Test environment jest-environment-jsdom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. Configuration Documentation: https://jestjs.io/docs/configuration As of Jest 28 "jest-environment-jsdom" is no longer shipped by default, make sure to install it separately.
I've looked at the
jest-environment-jsdom
page and have some reservations about installing packages without a readme. So I thoughtjsdom
would suffice, but it's doesn't and crashes with the same error.Expected Behavior
Not crashing on test start.
To Reproduce
The text was updated successfully, but these errors were encountered: