Skip to content

nx test (jest) cannot resolve tsconfig paths after migration to nx 14.x #10660

@hevans90

Description

@hevans90

Current Behavior

After migrating to nx 14, all my tests that import modules from aliased paths (from my libs) fail. The app builds fine and VSCode shows no issues with the module resolution, but when running tests, jest is no longer able to resolve my path aliases:

image

image

Expected Behavior

The tests should pass.

Steps to Reproduce

nx migrate latest on my main branch here:

https://github.com/hevans90/idleverse

Then nx test to run my default project's testing suite with the failing tests.

OR, check out this branch and nx test:

https://github.com/hevans90/idleverse/tree/build/nx-14


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

Failure Logs

Environment

Node : 16.13.2
OS : darwin x64
yarn : 1.22.18

nx : 14.2.2
@nrwl/angular : Not Found
@nrwl/cypress : 14.2.2
@nrwl/detox : Not Found
@nrwl/devkit : 14.2.2
@nrwl/eslint-plugin-nx : 14.2.2
@nrwl/express : Not Found
@nrwl/jest : 14.2.2
@nrwl/js : 14.2.2
@nrwl/linter : 14.2.2
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : 14.2.2
@nrwl/nx-cloud : 14.0.8
@nrwl/nx-plugin : Not Found
@nrwl/react : 14.2.2
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.2.2
@nrwl/web : 14.2.2
@nrwl/workspace : 14.2.2
typescript : 4.7.3

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions