Reputation: 1907
Jest's configuration states:
Jest's configuration can be defined in the
package.json
file of your project, or through ajest.config.js
file or through the--config <path/to/js|json>
option.
What happens if a configuration setting is defined in two or more places? Are distinct configuration settings merged together or can they be silently ignored? If merging or ignoring, do they have a well defined or ad hoc precedence?
Upvotes: 0
Views: 2611
Reputation: 1824
I inherited multiple projects with both a "jest" object in package.json and "jest.config.js" file, each with their specific configuration.
By playing (superficially) with the coverage threshold (which was < 97%), I came to the conclusion that jest.config.js is used, and the jest object in package.json is ignored. There doesn't seem to be any merging going on.
My tests:
#1: Which has priority ?
#2: Are they merged ?
Upvotes: 2