Skip to content
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(cli): fix --testRegex option on test command #784

Merged
merged 2 commits into from
Feb 16, 2023

Conversation

KaiVandivier
Copy link
Contributor

@KaiVandivier KaiVandivier commented Feb 13, 2023

Previously the path pattern would end up formatted incorrectly and would be useless, e.g. --testRegex=Alerts => /A|l|e|r|t|s/. This change makes the option work and we can filter tests! :D

I found the root of the error in the way the path patterns are built in the jest-config code: buildTestPathPattern()

It's surprising because the CLI accepts a singular option, but I guess since @jest/core isn't documented I shouldn't be that surprised πŸ€·β€β™‚οΈ

Both yarn test --testRegex=Alerts and passing a positional argument (yarn test Alerts) should work πŸŽ‰

@KaiVandivier KaiVandivier changed the title fix(cli): accept --testRegex option on test command fix(cli): fix --testRegex option on test command Feb 14, 2023
@KaiVandivier KaiVandivier requested review from amcgee and a team February 14, 2023 08:54
@KaiVandivier KaiVandivier merged commit 049cdf3 into master Feb 16, 2023
@KaiVandivier KaiVandivier deleted the fix-testRegex-option-on-test-command branch February 16, 2023 14:02
dhis2-bot added a commit that referenced this pull request Feb 16, 2023
## [10.2.2](v10.2.1...v10.2.2) (2023-02-16)

### Bug Fixes

* **cli:** fix `--testRegex` option on `test` command ([#784](#784)) ([049cdf3](049cdf3))
@dhis2-bot
Copy link
Contributor

πŸŽ‰ This PR is included in version 10.2.2 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants