-
-
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
fix(jest-config): normalize reporters
option defined in presets
#12769
Conversation
{} as Config.Argv, | ||
); | ||
|
||
expect(options.reporters).toEqual([['summary', {}]]); |
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.
Hm.. reporters
from preset is discarded if config includes reporters
key. Just thinking if this expected? Or it would be better to merge? Merging probably would make it impossible to disable reporters from a preset.
Edit: I just added a test, there is no change in behaviour. The test is passing on main
as well.
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.
not sure if ideal, but not something we should change here anyways
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.
good stuff 👍
We really should have runtime verification of the types out of normalize
... (@jest/schema
is supposed to enable that)
@@ -383,7 +383,7 @@ module.exports = { | |||
'no-dupe-args': 'error', | |||
'no-dupe-class-members': 'error', | |||
'no-dupe-keys': 'error', | |||
'no-duplicate-case': 'warn', | |||
'no-duplicate-case': 'error', |
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.
Perhaps? I just missed that warning, better if it errors?
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.
agreed, that's always an error I think
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. |
Fixes #12767
Summary
As it was described in the issue,
reporters
option defined in a preset is not normalized properly. Looking atjest-config
, one can see that preset options are merged afterreporters
option is normalized. To solve the issue normalization logic has be done later.Test plan
Unit test is added.