发布

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

    frostbyte_neo 发布于 2024-10-04 20:50:05 +00:00

    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 #

    下载附件