kentcdodds / kentcdodds/kcd-scripts

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

Aperta
#246 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
889
Fork
205
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

When running the precommit hook in [@testing-library/jest-dom](https://github.com/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: https://github.com/kentcdodds/kcd-scripts/blob/530b9ea2055af62721831605a3616cbe722bf3fb/src/config/jest.config.js#L43-L46

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with src/config/jest.config.js at the linked watchPlugins configuration and compare how the precommit hook runs kcd-scripts test with the direct npx kcd-scripts test --run command. Trace the differing Jest configuration or execution path, then verify that the precommit hook no longer emits the validation warning while the related-test behavior remains intact.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
cli, testing
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.