test: reduce the usage of defaultConfig #20619
Labels
priority-3-medium
Default priority, "should be done" but isn't prioritised ahead of others
status:in-progress
Someone is working on implementation
type:refactor
Refactoring or improving of existing code
Describe the proposed change(s).
In some tests we use
defaultConfig = getConfig()
which uses all the options, I think this is not a good idea because it creates incompatible type issues for the config objects as the type generated will beAllConfig
Examples:
renovate/lib/modules/manager/npm/extract/index.spec.ts
Line 11 in 8621d8c
renovate/lib/workers/repository/updates/generate.spec.ts
Line 273 in 8621d8c
It also makes it hard to debug tests if the config isn't minimal
So I propose to replace
defaultConfig = getConfig
-> smaller configs which are narrowed down to contain only the options needed for the specific testExample of what I mean:
The prev config only needs the default commit message options ie.
commitMessage(Action|Prefix|Topic)
Will be using this issue till all non-necessary usage of
defaultConfig
have been replaced. 👍The text was updated successfully, but these errors were encountered: