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

Simplify test pattern matching. #943

Closed
wants to merge 1 commit into from
Closed

Conversation

cpojer
Copy link
Member

@cpojer cpojer commented Apr 27, 2016

Fixes #925, #317, #290.

I'm starting to refactor how we find tests. This removes testFileExtensions and testDirectoryName in favor of a regex option for testsPattern. I tried to maintain the old config options with an adapter in normalize for now so that this isn't a breaking change. In a future release we'll add a warning and in a future-future release we will actually remove both options.

cc @DmitriiAbramov would really appreciate a review.

@ghost ghost added the CLA Signed ✔️ label Apr 27, 2016
@aaronabramov
Copy link
Contributor

sometimes it's really convenient to specify multiple patterns, e.g.

["/__server_tests__", "/__browser__tests__"]

or

["/_unit_/", "/_integration_"]

which can be done with a single regex but becomes too complicated :)

also if we even support glob patterns, should we rename this config option to regex? so eventually we can have

{
  testRegex: ["/__tests__/(.*)\\.js[x]?", "(?!node_modules)"]
}

or

{
  testPattern: ["**/__tests__/*.js?(x)", "!node_modules"]

@cpojer
Copy link
Member Author

cpojer commented Apr 28, 2016

I'll create a new pull request as I "accidentally" used master for this one. I'll follow your suggestion and call it testRegex.

@cpojer cpojer closed this Apr 28, 2016
@ghost
Copy link

ghost commented May 5, 2016

Any update on this? Is there a new PR that I can follow?

@cpojer
Copy link
Member Author

cpojer commented May 9, 2016

I was on vacation and am currently working on bringing this back to life :)

@github-actions
Copy link

This pull request 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 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"testPathPattern" is not working
2 participants