Skip to content

fix(jest-config): add missing options to ValidConfig to prevent spurious warnings#16224

Open
osfv wants to merge 1 commit into
jestjs:mainfrom
osfv:fix/add-missing-valid-config-options
Open

fix(jest-config): add missing options to ValidConfig to prevent spurious warnings#16224
osfv wants to merge 1 commit into
jestjs:mainfrom
osfv:fix/add-missing-valid-config-options

Conversation

@osfv

@osfv osfv commented Jun 2, 2026

Copy link
Copy Markdown

Summary

  • Adds findRelatedTests, outputFile, and replname to the initialOptions example config in ValidConfig.ts
  • These options are defined in jest-schemas and handled by normalize.ts, but were missing from the validation example config, causing false "Unknown option" warnings when users specify them in their Jest configuration

Closes #13576

Motivation

When jest-validate checks user configuration against the example config in ValidConfig.ts, any option not present in the example triggers a "Unknown option" warning. The three options added here are valid, documented options (two are CLI flags that can also be set in config files), but their absence from ValidConfig.ts causes confusing validation warnings.

Test plan

  • Verified all 161 tests in packages/jest-config/src/__tests__/normalize.test.ts pass
  • Verified all 30 tests in packages/jest-validate pass
  • Confirmed ESLint passes with no warnings on the changed file
  • Confirmed alphabetical sort-keys order is maintained

@netlify

netlify Bot commented Jun 2, 2026

Copy link
Copy Markdown

Deploy Preview for jestjs failed.

Built without sensitive environment variables

Name Link
🔨 Latest commit 33d48ec
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/6a1ef711ce62df0008cb7a9b

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 2, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: osfv / name: iqad (33d48ec)

@github-actions github-actions Bot added the require-changelog If a PR does requires a changelog entry label Jun 2, 2026
…ous warnings

`findRelatedTests`, `outputFile`, and `replname` are valid configuration
options defined in jest-schemas and handled by normalize, but were missing
from the ValidConfig example config used by jest-validate. This caused
users to receive false "Unknown option" validation warnings.

Closes jestjs#13576
@osfv osfv force-pushed the fix/add-missing-valid-config-options branch from 2fef551 to 33d48ec Compare June 2, 2026 15:30
@pkg-pr-new

pkg-pr-new Bot commented Jun 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@16224

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@16224

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@16224

create-jest

npm i https://pkg.pr.new/create-jest@16224

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@16224

expect

npm i https://pkg.pr.new/expect@16224

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@16224

jest

npm i https://pkg.pr.new/jest@16224

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@16224

jest-circus

npm i https://pkg.pr.new/jest-circus@16224

jest-cli

npm i https://pkg.pr.new/jest-cli@16224

jest-config

npm i https://pkg.pr.new/jest-config@16224

@jest/console

npm i https://pkg.pr.new/@jest/console@16224

@jest/core

npm i https://pkg.pr.new/@jest/core@16224

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@16224

jest-diff

npm i https://pkg.pr.new/jest-diff@16224

jest-docblock

npm i https://pkg.pr.new/jest-docblock@16224

jest-each

npm i https://pkg.pr.new/jest-each@16224

@jest/environment

npm i https://pkg.pr.new/@jest/environment@16224

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@16224

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@16224

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@16224

@jest/expect

npm i https://pkg.pr.new/@jest/expect@16224

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@16224

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@16224

@jest/globals

npm i https://pkg.pr.new/@jest/globals@16224

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@16224

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@16224

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@16224

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@16224

jest-message-util

npm i https://pkg.pr.new/jest-message-util@16224

jest-mock

npm i https://pkg.pr.new/jest-mock@16224

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@16224

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@16224

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@16224

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@16224

jest-resolve

npm i https://pkg.pr.new/jest-resolve@16224

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@16224

jest-runner

npm i https://pkg.pr.new/jest-runner@16224

jest-runtime

npm i https://pkg.pr.new/jest-runtime@16224

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@16224

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@16224

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@16224

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@16224

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@16224

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@16224

@jest/transform

npm i https://pkg.pr.new/@jest/transform@16224

@jest/types

npm i https://pkg.pr.new/@jest/types@16224

jest-util

npm i https://pkg.pr.new/jest-util@16224

jest-validate

npm i https://pkg.pr.new/jest-validate@16224

jest-watcher

npm i https://pkg.pr.new/jest-watcher@16224

jest-worker

npm i https://pkg.pr.new/jest-worker@16224

pretty-format

npm i https://pkg.pr.new/pretty-format@16224

commit: 33d48ec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

require-changelog If a PR does requires a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Validation warnings for options like preset or coverage directory

1 participant