-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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): allows getJestProjects to fetch config information from inferred plugins #21806
Conversation
… inferred plugins After updating my codebase to use the new plugin inference system, I found that I could no longer run pnpm jest at the root of my repo. This change allows the getJestProject methods to pull from retrieveProjectConfigurations in order to find all project config files.
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 52bee82. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 5 targets
Sent with 💌 from NxCloud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to contribute!
These changes turn the getJestProjects
function into an async function, so the generated jest.config.ts
at the workspace root needs to account for that. It's currently expecting a sync function.
Also, these changes don't really address the issue you're trying to solve. The inferred targets for Jest don't use the @nx/jest:jest
executor, so they wouldn't be collected because in this function, we only look for targets with that executor. Those inferred targets use the nx:run-commands
executor, and they use the command jest
. On top of that, users could also overwrite the command in the project configuration to provide some extra args (e.g. jest --runInBand
).
Thanks again for contributing! I'm going to close this in favor of #21897. We're instead adding a separate function to not break existing usages. |
Sounds good! Thank you for addressing!
…On Thu, Feb 22, 2024 at 3:56 AM Leosvel Pérez Espinosa < ***@***.***> wrote:
Thanks again for contributing! I'm going to close this in favor of #21897
<#21897>. We're instead adding a separate
function to not break existing usages.
—
Reply to this email directly, view it on GitHub
<#21806 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXEGUWAREQMQZKFSHQ7AITYU4B25AVCNFSM6AAAAABDHKWNYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJYHE4DCNBZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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. |
After updating my codebase to use the new plugin inference system, I found that I could no longer run pnpm jest at the root of my repo.
This change allows the getJestProject methods to pull from retrieveProjectConfigurations in order to find all project config files.
Current Behavior
When running
pnpm jest
at the root of the application,getJestProjects
returns empty if there is not an explicittest
target in the project.jsonExpected Behavior
Running
pnpm jest
should run all valid Jest projects in the repository.This is my first contribution to NX, happy to make any changes necessary and would love feedback!