The Jest configuration does not have to be in the package.json
, it can be put in an external file.
Create a .jestrc file
Create a .jestrc
file and put your configuration inside. The format is still JSON but the ”jest”: { … }”
key at the root is omitted.
{ |
becomes
{ |
Link configuration
Use the —config
option when calling jest to use the .jestrc
file in lieu of the package.json section
$ jest —config .jestrc |
Enjoy !