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
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
A permanent config option for testNameMatch and/or testNameRegex
When utilizing testNameMatch and/or testNameRegex in the config file, an array of patterns may be specified.
Like their path counterparts, testNameMatch supports glob patterns with micromatch, and testNameRegex supports regex patterns.
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.
AELSchauer
changed the title
Allow configuring using array of patterns for testNamePattern
Allow configuring using array of patterns to match test names
Jul 15, 2019
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.
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.
🚀 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
testNameMatch
and/ortestNameRegex
testNameMatch
and/ortestNameRegex
in the config file, an array of patterns may be specified.testNameMatch
supports glob patterns with micromatch, andtestNameRegex
supports regex patterns.testNameMatch
andtestNameRegex
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
The text was updated successfully, but these errors were encountered: