You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(testing): fix passing extra args to Jest cli (#27704)
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\\[email protected]_@[email protected]_@[email protected]_\\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 <[email protected]>
(cherry picked from commit 8266785)
0 commit comments