Skip to content

Commit 0ca6e3f

Browse files
authored
chore(testing): resolve @nx/dotnet to source in jest tests (#35399)
## Current Behavior Running `nx test dotnet` resolves `@nx/dotnet/*` specifiers to compiled `dist/*.js` files instead of TypeScript source. `scripts/patched-jest-resolver.js` maintains a `workspacePackages` allowlist of `@nx/*` packages that should route to their TS source during tests. `@nx/dotnet` is missing from that list, so the resolver falls through to `enhanced-resolve`, which honors `packages/dotnet/package.json#exports` — and those entries all point at `./dist/*.js`. Every other `@nx/*` plugin in the repo is on the allowlist, so this is specific to `@nx/dotnet`. ## Expected Behavior `nx test dotnet` resolves `@nx/dotnet/*` imports to TypeScript source files under `packages/dotnet/src/` like every other workspace package, so tests exercise the current source and don't require a prior build. ## Related Issue(s) <!-- None; internal dev loop fix surfaced while running the dotnet test suite. -->
1 parent ae43589 commit 0ca6e3f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

scripts/patched-jest-resolver.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module.exports = function (modulePath, options) {
5151
'@nx/vite',
5252
'@nx/jest',
5353
'@nx/docker',
54+
'@nx/dotnet',
5455
'@nx/js',
5556
'@nx/next',
5657
'@nx/storybook',

0 commit comments

Comments
 (0)