Can you create a minimal project reproducing the problem?
Sure. This is a create-react-app with husky and two simple tests. if you change anything in the repo, even unrelated to the tests, and commit, you'll see husky runs all tests. It can get very slow in a large project.
https://github.com/jazzdragon/test-flags-demo
Thanks!
bump?
+1
Revisiting this, I don't think we'll go out of our way to support running test as a precommit hook.
It's not obvious to me why it runs all tests rather than tests related to changed files. But I don't have the time to investigate this. If you find it out and think it's a bug in CRA, we're happy to take a fix.