Install jest
and jest-watch-master
yarn add --dev jest jest-watch-master
# or with NPM
npm install --save-dev jest jest-watch-master
In your package.json
:
{
"jest": {
"watchPlugins": ["jest-watch-master"]
}
}
Or in jest.config.js
module.exports = {
// ...
watchPlugins: ['jest-watch-master'],
};
To specify a branch other than master, use the branch
setting:
{
"jest": {
"watchPlugins": [["jest-watch-master", { "branch": "feature" }]]
}
}