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

Missing jest-environment-jsdom dependency since jest 28 was introduced #12744

Closed
mathis-m opened this issue Oct 21, 2022 · 1 comment · Fixed by #12747
Closed

Missing jest-environment-jsdom dependency since jest 28 was introduced #12744

mathis-m opened this issue Oct 21, 2022 · 1 comment · Fixed by #12747

Comments

@mathis-m
Copy link

Current Behavior

After migrating from nx ^14.3.6 to ^15.0.0, running test target for a library results in the following error:

 >  NX   ● 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.
   Pass --verbose to see the stacktrace.

See breaking changes of jest

Expected Behavior

Introduced with #10857, the dev dependency to jest-environment-jsdom shall be added upon migration and when creating a new library with tests.

Steps to Reproduce

  1. Setup library with nx version prior the stated PR.
  2. Apply migration
  3. Execute nx run my-lib:test
  4. See error

Failure Logs

 >  NX   ● 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.
   Pass --verbose to see the stacktrace.

Environment


 >  NX   Report complete - copy this into the issue template

   Node : 16.15.1
   OS   : win32 x64
   npm  : 8.11.0
   
   nx : 15.0.0
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.0.0
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.0.0
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.0.0
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.0.0
   @nrwl/js : 15.0.0
   @nrwl/linter : 15.0.0
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : 15.0.0
   @nrwl/react : 15.0.0
   @nrwl/react-native : Not Found
   @nrwl/rollup : 15.0.0
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.0.0
   @nrwl/web : 15.0.0
   @nrwl/webpack : 15.0.0
   @nrwl/workspace : 15.0.0
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
         *****/***** (redacted information)
   ---------------------------------------
   Community plugins:

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant