You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When migrating to NX20 in a mono-repo, the implicit 'test'-target from @nx/jest/plugin has disappeared.
Situation:
Full NX mono-repo, with components in /packages/ and supporting stuff like storybook in /libs/. Complete setup with jest, separate jest.configs in the /libs/ and /packages/, and a target setup in the root nx.json like this:
And this makes the test target disappear, meaning we get this error: NX Cannot find configuration for task component-library:test
Upon investigating the NX -source code, we found this (plugin.ts)
if (jestConfigContent.includes('getJestProjectsAsync()')) {
// The `getJestProjectsAsync` function uses the project graph, which leads to a
// circular dependency. We can skip this since it's no intended to be used for
// an Nx project.
return {};
}
This confuses me:
so if jestProjectAsync is present, do not add the implicit target ? But this is what the documentation says me to do, no?
"not intended to be used for an nx project"?
I kinda get the circular dependency reference, but then how should we use this @nx/jest plugin?
Expected Behavior
I did not expect the 'test' target to disappear.
So it would be nice to have some kind of a warning/error from the @nx/jest/plugin.
Current Behavior
When migrating to NX20 in a mono-repo, the implicit 'test'-target from @nx/jest/plugin has disappeared.
Situation:
Full NX mono-repo, with components in /packages/ and supporting stuff like storybook in /libs/. Complete setup with jest, separate jest.configs in the /libs/ and /packages/, and a target setup in the root nx.json like this:
A jest.config.ts like
When migrating to NX20, and after running the provided migration, this becomes:
And this makes the test target disappear, meaning we get this error:
NX Cannot find configuration for task component-library:test
Upon investigating the NX -source code, we found this (plugin.ts)
This confuses me:
I kinda get the circular dependency reference, but then how should we use this @nx/jest plugin?
Expected Behavior
I did not expect the 'test' target to disappear.
So it would be nice to have some kind of a warning/error from the @nx/jest/plugin.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
npm
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: