Skip to content

Jest emits validation warnings in precommit hook due to unknown option "watchPlugins" #246

@TrevorBurnham

Description

@TrevorBurnham

When running the precommit hook in @testing-library/jest-dom, I noticed this warning:

✖ kcd-scripts test --findRelatedTests:
● Validation Warning:

  Unknown option "watchPlugins" with value ["/Users/trevor.burnham/code/jest-dom/node_modules/jest-watch-typeahead/build/file_name_plugin/plugin.js", "/Users/trevor.burnham/code/jest-dom/node_modules/jest-watch-typeahead/build/test_name_plugin/plugin.js"] was found.
  This is probably a typing mistake. Fixing it will remove this message.

  Configuration Documentation:
  https://jestjs.io/docs/configuration

That configuration option is set here:

watchPlugins: [
require.resolve('jest-watch-typeahead/filename'),
require.resolve('jest-watch-typeahead/testname'),
],

Honestly I'm puzzled by this warning. npx jest --version returns 29.7.0, and the docs for that version show watchPlugins as a valid configuration option: https://jestjs.io/docs/29.7/configuration#watchplugins-arraystring--string-object

Additionally, I only see the warning when kcd-scripts test runs in the precommit hook. If I run npx kcd-scripts test --run, there's no such warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions