nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.28k stars 2.32k forks source link

Error running jest tests after update to nx 15 #12720

Closed yharaskrik closed 1 year ago

yharaskrik commented 1 year ago

Current Behavior

When running tests with jest

  ✖  nx run ngrx-data-websocket-client:test
       >  NX   Cannot find module '@babel/helper-get-function-arity'

          Require stack:
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/node_modules/@babel/helper-function-name/lib/index.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/node_modules/@babel/traverse/lib/path/conversion.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/node_modules/@babel/traverse/lib/path/index.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/node_modules/@babel/traverse/lib/context.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/node_modules/@babel/traverse/lib/traverse-node.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/node_modules/@babel/traverse/lib/index.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/build/InlineSnapshots.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/build/State.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-snapshot/build/index.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest-runtime/build/index.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/@jest/core/build/cli/index.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/@jest/core/build/index.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/jest/build/index.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/@nrwl/jest/src/executors/jest/jest.impl.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/nx/src/config/workspaces.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/nx/src/command-line/run.js
          - /Users/jaybell/WebstormProjects/trellis-platform/node_modules/nx/bin/run-executor.js
          Pass --verbose to see the stacktrace.

Expected Behavior

Should not fail. Adding @babel/helper-get-function-arity to my deps succeeds.

Steps to Reproduce

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

Environment

>  NX   Report complete - copy this into the issue template

   Node : 14.20.1
   OS   : darwin x64
   yarn : 1.22.17

   nx : 15.0.0
   @nrwl/angular : 15.0.0
   @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 : 15.0.0
   @nrwl/next : Not Found
   @nrwl/node : 15.0.0
   @nrwl/nx-cloud : 15.0.0
   @nrwl/nx-plugin : 15.0.0
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.0.0
   @nrwl/web : Not Found
   @nrwl/webpack : 15.0.0
   @nrwl/workspace : 15.0.0
   typescript : 4.8.4
barbados-clemens commented 1 year ago

What does your project level root config look like? And related babel configs?

yharaskrik commented 1 year ago

Was this PR that did it. (obviously this branch is with the fix of installing that other babel package)

https://github.com/trellisorg/platform/pull/283

Heres the branch

https://github.com/trellisorg/platform/tree/jaybell/upgrade-to-nx-15

barbados-clemens commented 1 year ago

Wonder if it's something with jest 29. We haven't officially made that migration.

yharaskrik commented 1 year ago

Oh you haven't? I wonder how I got on 29 then... I must have upgraded myself.

barbados-clemens commented 1 year ago

Most likely. could have been dependabot or something as well. just waiting on jest-preset-angular to release support. odds are most things will work but ts-jest did have breaking change with no longer using globals for specifying options. now passed as transformer options.

you can follow #11892 for updates on jest 29 support.

Gonna close for now since technically unsupported right now. but I'll keep this in mine when testing jest 29. Glad it's kind of "just been working" minus this little issue.

yharaskrik commented 1 year ago

Most likely. could have been dependabot or something as well. just waiting on jest-preset-angular to release support. odds are most things will work but ts-jest did have breaking change with no longer using globals for specifying options. now passed as transformer options.

you can follow #11892 for updates on jest 29 support.

Gonna close for now since technically unsupported right now. but I'll keep this in mine when testing jest 29. Glad it's kind of "just been working" minus this little issue.

Sounds good to me! Sorry I opened an issue for something unsupported, had no idea!

github-actions[bot] commented 1 year ago

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.