Unknown option "detectOpenHandles" with value true was found.
See original GitHub issueš Bug Report
Iām trying to add detectOpenHandles from the CLI to package.json config for jest but getting this validation warning:
ā Validation Warning:
Unknown option "detectOpenHandles" with value true was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration.html
To Reproduce
This is my jest config in package.json:
"jest": {
"testTimeout": 30000,
"restoreMocks": true,
"forceExit": true,
"detectOpenHandles": true,
"silent": true
},
I donāt get warnings on any of those other options even though others like forceExit and silent are not in the configuration guide:
https://jestjs.io/docs/en/configuration
Meaning, I assumed that detectOpenHandles not being in the configuration guide was just a docs issue and that anything in the CLI guide can be used as config options but CLI overrides them as noted here:
https://jestjs.io/docs/en/cli#options
Note: CLI options take precedence over values from the Configuration.
Expected behavior
I expect to be able to specify the CLI options as config options. Note that the CLI docs say:
Every one of Jestās Configuration options can also be specified through the CLI.
So I assumed that goes both ways.
Link to repl or repo (highly encouraged)
This should be pretty easy to reproduce assuming the warning isnāt due to some misconfiguration on my part.
envinfo
$ npx envinfo --preset jest
npx: installed 1 in 0.812s
System:
OS: Linux 5.3 Ubuntu 18.04.3 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 13.5.0 - /usr/bin/node
npm: 6.13.4 - /usr/bin/npm
npmPackages:
jest: ^24.9.0 => 24.9.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:5 (1 by maintainers)

Top Related StackOverflow Question
Same here
Same issue with
detectLeaks. Why would you put it in theimport { config } = @types/jest/if itās not actually availableā¦