Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

jaysoo
Copy link
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
Copy link

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

@FrozenPandaz FrozenPandaz merged commit cbda8cf into master Oct 4, 2024
6 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/jest-get-projects-async branch October 4, 2024 20:50
Copy link

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