[Bug]: Validation warnings for options like preset or coverage directory
See original GitHub issueVersion
29.3.0
Steps to reproduce
Use a jest.config.ts
like:
export default {
preset: './jest.preset.js',
coverageDirectory: './coverage',
};
Expected behavior
Run tests using ./node_modules/.bin/jest
without any warnings.
Actual behavior
● Validation Warning:
Unknown option "preset" with value "./jest.preset.js" was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration
● Validation Warning:
Unknown option "coverageDirectory" with value "./coverage" was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration
Additional context
Might be related to the missing default option for preset or coverage in packages/jest-config/src/ValidConfig.ts
.
Environment
System:
OS: macOS 13.0
CPU: (8) arm64 Apple M1 Pro
Binaries:
Node: 16.18.0 - ~/.volta/tools/image/node/16.18.0/bin/node
Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
npm: 8.19.2 - ~/.volta/tools/image/node/16.18.0/bin/npm
npmPackages:
jest: ^29.3.0 => 29.3.0
Issue Analytics
- State:
- Created 10 months ago
- Reactions:30
- Comments:22 (1 by maintainers)
Top Results From Across the Web
Configuring Jest
By default, Jest runs all tests and produces all errors into the console upon completion. ... The directory where Jest should output its...
Read more >ReSharper - Configure code inspection settings - JetBrains
Select ReSharper | Options from the main menu or press Alt+R O , then choose Code Inspection | Settings on the left.
Read more >Troubleshooting Code Coverage - Visual Studio (Windows)
See if there are any warnings or errors logged. Explanation—Code coverage analysis is done while tests are running.
Read more >What type of errors could my code still contain even if I have ...
Any kind of ordinary logic bug, I guess? Memory corruption, buffer overrun, plain old wrong code, assignment-instead-of-test, the list goes on. Coverage is...
Read more >Validation | Kiali
A description and complete list of Kiali validations. ... source: namespaces: - default - non-existing # warning - unexisting # warning to: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello. I do have the same issue with the
coverageDirectory
andcoverageReporters
options. I am using the29.3.1
version.If I understand this issue correctly:
projects
entry) are using configuration settings likecoverageDirectory
,coverageReporters
, andcollectCoverageFrom
that can only apply at the global level.projects
) shouldn’t have these settings.Am I understanding correctly?
In my opinion, it’s sometimes useful to be able to use global settings in project configs - maybe you want to reuse a single configuration object for both, or maybe you want each package in a monorepo to have a
jest.config.ts
so that Jest can be run at the monorepo level or per project and share the same configs. (NX, for example, defaults to putting global settings in per-project configs, for whatever reason.) Maybe Jest shouldn’t warn on this, or should only warn if--debug
or--showConfig
is given, or should wait until Jest 30 and make a concrete recommendation about stricter separation of global and project settings then?