Skip to content

fix(testing): getJestProjectsAsync no longer duplicates project paths#28311

Merged
FrozenPandaz merged 1 commit intomasterfrom
fix/jest-get-projects-async
Oct 4, 2024
Merged

fix(testing): getJestProjectsAsync no longer duplicates project paths#28311
FrozenPandaz merged 1 commit intomasterfrom
fix/jest-get-projects-async

Conversation

@jaysoo
Copy link
Copy Markdown
Member

@jaysoo jaysoo commented Oct 4, 2024

Current Behavior

Using getJestProjectsAsync to include both project.json and inferred targets can result in errors due to duplcicated paths.

You see an error like this:

Error: Whoops! Two projects resolved to the same config path: /Users/jack/projects/ocean/libs/nx-cloud/data-access-organization-dashboard/jest.config.ts:

  Project 1: /Users/jack/projects/ocean/libs/nx-cloud/data-access-organization-dashboard/jest.config.ts
  Project 2: /Users/jack/projects/ocean/libs/nx-cloud/data-access-organization-dashboard

This usually means that your "projects" config includes a directory that doesn't have any configuration recognizable by Jest. Please fix it.

    at ensureNoDuplicateConfigs (/Users/jack/projects/ocean/node_modules/jest-config/build/index.js:325:13)
    at readConfigs (/Users/jack/projects/ocean/node_modules/jest-config/build/index.js:474:5)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runCLI (/Users/jack/projects/ocean/node_modules/jest-cli/node_modules/@jest/core/build/cli/index.js:151:59)
    at async Object.run (/Users/jack/projects/ocean/node_modules/jest-cli/build/run.js:130:37)

Expected Behavior

Using getJestProjectsAsync should work and include all inferred projects.

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner October 4, 2024 18:39
@jaysoo jaysoo requested a review from FrozenPandaz October 4, 2024 18:39
@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Oct 4, 2024 6:41pm

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Oct 4, 2024

@FrozenPandaz FrozenPandaz merged commit cbda8cf into master Oct 4, 2024
@FrozenPandaz FrozenPandaz deleted the fix/jest-get-projects-async branch October 4, 2024 20:50
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants