fix(testing): forward extra args to the jest cli through the process.argv in jest executor#27704
Merged
leosvelperez merged 3 commits intoJan 29, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
Contributor
|
View your CI Pipeline Execution ↗ for commit eaa7a54.
☁️ Nx Cloud last updated this comment at |
40d2e86 to
56e5336
Compare
cb63dad to
039a471
Compare
46d3fac to
3f28c91
Compare
ec6b727 to
aea11b5
Compare
1e3f934 to
ef55f09
Compare
ef55f09 to
d3015c8
Compare
d3015c8 to
f0f75a5
Compare
leosvelperez
approved these changes
Jan 29, 2025
leosvelperez
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution!
process.argv in jest executor
process.argv in jest executorprocess.argv in jest executor
FrozenPandaz
pushed a commit
that referenced
this pull request
Feb 6, 2025
Small fix for using jest-runner-groups(https://www.npmjs.com/package/jest-runner-groups) with Nx. ## Current Behavior When running jest executor with extra group argument like: ``` nx run app-nebula-explorer-api:test --group=unit ``` `jest-runner-groups` runs all tests, not only from selected group. From my investigation, `jest-runner-groups` using process.argv to extract `--group` args https://github.com/eugene-manuilov/jest-runner-groups/blob/3c9d3cf4cb3e595bdea733100f2bdc8d64f871d7/index.js#L57 and `process.argv` passed to runner contains: ```javascript [ 'M:\\programs\\nodejs\\22\\node.exe', 'M:\\projects\\someproject\\node_modules\\.pnpm\\nx@19.3.2_@swc+core@1.6.6_@swc+helpers@0.5.11_\\node_modules\\nx\\bin\\run-executor.js' ] ``` ## Expected Behavior Running jest executor with jest-runner-groups runner and `--group` args should run only tests from group. ## PR changes summary I implemented fix as generic and any extra arg will be added to `process.argv` . --------- Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com> (cherry picked from commit 8266785)
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small fix for using jest-runner-groups(https://www.npmjs.com/package/jest-runner-groups) with Nx.
Current Behavior
When running jest executor with extra group argument like:
jest-runner-groupsruns all tests, not only from selected group.From my investigation,
jest-runner-groupsusing process.argv to extract--groupargshttps://github.com/eugene-manuilov/jest-runner-groups/blob/3c9d3cf4cb3e595bdea733100f2bdc8d64f871d7/index.js#L57
and
process.argvpassed to runner contains:Expected Behavior
Running jest executor with jest-runner-groups runner and
--groupargs should run only tests from group.PR changes summary
I implemented fix as generic and any extra arg will be added to
process.argv.