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 testPathPatterns when config is in subdirectory #14934
Open
brandonchinn178
wants to merge
10
commits into
jestjs:main
Choose a base branch
from
brandonchinn178:bchinn-testpathpatterns-subprojects
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix testPathPatterns when config is in subdirectory #14934
brandonchinn178
wants to merge
10
commits into
jestjs:main
from
brandonchinn178:bchinn-testpathpatterns-subprojects
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
brandonchinn178
force-pushed
the
bchinn-testpathpatterns-subprojects
branch
from
March 3, 2024 19:00
cadc8f9
to
1ef878f
Compare
brandonchinn178
force-pushed
the
bchinn-testpathpatterns-subprojects
branch
from
March 3, 2024 20:13
1ef878f
to
827b3e2
Compare
brandonchinn178
force-pushed
the
bchinn-testpathpatterns-subprojects
branch
2 times, most recently
from
March 7, 2024 04:10
ca5fc7e
to
7da18ae
Compare
brandonchinn178
force-pushed
the
bchinn-testpathpatterns-subprojects
branch
from
March 7, 2024 06:12
7da18ae
to
f8c5a96
Compare
@SimenB Okay CI should be good now! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #14726. No CHANGELOG entry, as it fixes an issue with a new feature that's already in the CHANGELOG.
Follow up to #12519 (which fixes both #10746 and #8226). In this PR, we separate the
TestPathPatterns
class into two classes: one that just represents the list of patterns and one that can match the patterns against a test file. The separation is necessary because there are some uses where we aren't in a project, and can't match against a regex, but we do want to do static analysis of the patterns. For example, when outputting the test summary, we want to show the patterns the user specified, but the summary is global, not per-project.I also made a change I had wanted to do in the initial PR, which is store
TestPathPatterns
directly inGlobalConfig
. Now, the fact that patterns are represented asArray<string>
is an implementation detail, and everything using the patterns can only use the provided API.This will make even more sense when
rootDir
is removed fromGlobalConfig
, as discussed. It would be even nicer ifProjectConfig
storedTestPathPatternsExecutor
, but it was getting weird withInitialProjectConfig
, so I didn't want to touch that.Test plan
I wrote a new test that is executed with
yarn jest testPathPatterns
. It fails on main with "no tests found", and passes on this branch.