Configuring Jest

Configuring Jest

Jest's configuration can be defined in the package.json file of your project, through a jest.config.js file or or through the --config <path/to/js|json> option. If you'd like to use your package.json to store Jest's config, the "jest" key should be used on the top level so Jest will know how to find your settings:

{
  "name": "my-project",
  "jest": {
    "verbose": true
  }
}

Or through JavaScript:

// jest.config.js
module.exports = {
  verbose: true,
};

Please keep in mind that the resulting configuration must be JSON-serializable.

When using the --config option, the JSON file must not contain a "jest" key:

{
  "bail": true,
  "verbose": true
}