-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Make lastCommit and changedFilesWithAncestor work through config #5476
Conversation
@@ -38,12 +38,6 @@ describe('check', () => { | |||
); | |||
}); | |||
|
|||
it('sets onlyChanged if lastCommit is specified', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case is removed because it does not apply anymore; the logic has been moved to normalize
in jest-config
. Which, in turn, it's the right place to have it (argv
should be read-only).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -571,6 +571,16 @@ export default function normalize(options: InitialOptions, argv: Argv) { | |||
); | |||
} | |||
|
|||
for (const key of [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to extract these special options? https://github.com/facebook/jest/pull/5476/files#diff-a6aea6252dbe0924a79aabb9b1fb581dL23
I really like this change 👍 |
Codecov Report
@@ Coverage Diff @@
## master #5476 +/- ##
=========================================
+ Coverage 61.42% 62.23% +0.8%
=========================================
Files 213 205 -8
Lines 7057 6935 -122
Branches 3 4 +1
=========================================
- Hits 4335 4316 -19
+ Misses 2721 2618 -103
Partials 1 1
Continue to review full report at Codecov.
|
It'd be nice to get a +1 on that one 🙃 |
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. |
This change makes
changedFilesWithAncestor
andlastCommit
work both via configuration and via CLI. Before that, they could only be used in CLI, and adding them to the configuration (eitherpackage.json
or a separate JSON file) will cause them either to be ignored or complain as an invalid parameter. This required to move as well some of the logic deeper into configuration normalization.On the other side, I also improved the ancestor logic for Mercurial. Instead of just using the last commit, it will try to find the root of the branch. The reason for the change is that it is extremely confusing to see tests getting/not-getting executed when your branch has a bunch of stacked commits.