-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(testing): forward extra args to the jest cli through the process.argv
in jest executor
#27704
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): forward extra args to the jest cli through the process.argv
in jest executor
#27704
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
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
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 the contribution!
process.argv
in jest executorSmall 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)
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. |
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-groups
runs all tests, not only from selected group.From my investigation,
jest-runner-groups
using process.argv to extract--group
argshttps://github.com/eugene-manuilov/jest-runner-groups/blob/3c9d3cf4cb3e595bdea733100f2bdc8d64f871d7/index.js#L57
and
process.argv
passed to runner contains: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
.