I am trying to pass along a configuration file to Jest in order to run tests only from a given directory.
According to documentation, you can use config.testPathDi
The docs were updated to explain the configuration. Here is the link for anyone looking for more information:
https://facebook.github.io/jest/docs/en/configuration.html#content
The gist:
If using the --config
to direct jest to your configuration json file, you only put the JSON information in the file without the "jest" keyword.
// config.json at
{
"verbose": true
}
If you want to use the package.json to configure jest, add the "jest" key and then your configuration.
// package.json
{
"name": "packageName",
"version": "1.0.0",
"jest": {
"verbose": true
}
}