I'm using husky in my lerna monorepo project which has more than one directory (project)
.husky
front
├── package.json
app
└── package.json
on hook prepush
I launch my test on front/ and app/ with yarn test
.
I would like to have the test for a folder (project) only when the code inside change. Like github Actions.
on:
paths:
- 'front/**'
do there is a way in Husky ?
lint-staged
are designed for, they pass a list of the staged files to the commands you supply (which you could use with the above Jest flag, for example). So Husky -> lint-staged -> whatever scripts runs the test/lint/whatever given a list of files. – Pseudocarp