Nx 13.10 breaks `jest-runner-groups`
See original GitHub issuePreface
For those unaware, jest-runner-groups
allows you to “annotate” a test file with a group name, e.g.
/**
* @group foo
*/
This allows you to only run certain tests
Current Behavior
When using jest-runner-groups
:
nx affected:test --group=foo
runs tests that have not been annotated with the groupfoo
nx affected:test --group=-foo
runs tests that have been annotated with the groupfoo
- If I manually run Jest in one of the apps/libs, then the
--group
flag works as expected
Expected Behavior
When using jest-runner-groups
:
nx affected:test --group=foo
should only run tests that have been annotated with the groupfoo
nx affected:test --group=-foo
should only run tests that have not been annotated with the groupfoo
Steps to Reproduce
- Use
jest-runner-groups
in a repo using Nx13.9.7
, and see that test filtering works as expected - Update Nx to 13.10.2, and see that all tests are run, regardless of what
--group
flag is passed
Failure Logs
n/a
Environment
Node : 16.14.1
OS : win32 x64
npm : 8.5.0
nx : 13.10.2
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 13.10.2
@nrwl/eslint-plugin-nx : 13.10.2
@nrwl/express : Not Found
@nrwl/jest : 13.10.2
@nrwl/js : 13.10.2
@nrwl/linter : 13.10.2
@nrwl/nest : 13.10.2
@nrwl/next : Not Found
@nrwl/node : 13.10.2
@nrwl/nx-cloud : 13.3.1
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/workspace : 13.10.2
typescript : 4.3.5
rxjs : 7.5.5
At a guess, I’d say that the --group
flag isn’t actually being passed to Jest, even though Nx says that it is running the command with that flag
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
What is new in Nx 13.10?
Build and run Nx Plugins locally in your Nx workspace · Nx core which provides the fundamental features such as the dependency graph...
Read more >Nx 13 Migration failure: update-tasks-runner - Stack Overflow
Failed to run 13-10-0-update-tasks-runner from @nrwl/workspace. This workspace is NOT up to date! Cannot read property 'default' of undefined.
Read more >Migrating an Angular CLI project to Nx
This command will install the correct version of Nx based on your Angular version. This will enable you to use the Nx CLI...
Read more >nx - npm
Nx is a next generation build system with first class monorepo support and powerful integrations. Getting Started. Creating an Nx Workspace.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Issue is still present @Ezard your fix is working, one minor change (if you need to run tests from WebStorm/IntelliJ Idea)
It passes extra arguments, so it’s safer to do something like this
Also to use multiple args (like
--group=a --group=b
) make sure to use solution (above) with (process.argv.push(...config.overrides.group.map((g) => `--group=${g}`))
)@npwork I’ve integrated your suggestions into v1.1.0 of
jest-runner-groups-nx
(with a bit of tweaking since, from testing, your solution worked for multiple groups but not single groups)