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

Allow configuring using array of patterns to match test names #8683

Closed
AELSchauer opened this issue Jul 12, 2019 · 3 comments
Closed

Allow configuring using array of patterns to match test names #8683

AELSchauer opened this issue Jul 12, 2019 · 3 comments

Comments

@AELSchauer
Copy link

AELSchauer commented Jul 12, 2019

🚀 Feature Proposal

Currently, testNamePattern is only documented as a CLI feature, but it can be added to the config file. However, in the config file, it only allows for a single regex string. However, testRegex, testPath, etc. all utilize an array of patterns that may apply.

Requirements

  1. A permanent config option for testNameMatch and/or testNameRegex
  2. When utilizing testNameMatch and/or testNameRegex in the config file, an array of patterns may be specified.
  3. Like their path counterparts, testNameMatch supports glob patterns with micromatch, and testNameRegex supports regex patterns.
  4. Like their path counterparts, if bothtestNameMatch and testNameRegex are implemented, both cannot be used at the same time.

Motivation

Utilizing "tags" in a test name is a helpful, dynamic way of organizing code. For example @mobile or ^desktop. Mocha documentation recommends this way of tagging code.

However, if wanting to apply multiple search queries, we must create a very complex, fragile regex query instead of being able to apply multiple queries. We can also not utilize glob queries, which are supported for paths.

Example

//jest.config.js
...
"testNameMatch":['*@desktop*' ,'*!@mobile*'],
"testNameRegex": ['.*@desktop.*', '.*\(w\/o JS\).*']
...
@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 25, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions
Copy link

github-actions bot commented May 3, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant