-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i run tests before commit using lint-staged and react-scripts? #2336
Comments
|
@spacecrio this is how I implement it "scripts": {
"precommit": "lint-staged",
"test:staged": "cross-env CI=true react-scripts test --env=jsdom --findRelatedTests"
} then "lint-staged": {
"src/**/*.js": [
"test:staged",
"git add"
]
} for the env variable, use cross-env.. it is cross platform hope it helps! |
@luftywiranda13 its work, thank you But it would be great to be able to just run all tests like run "$ yarn jest" in the project created by the creat-reaction-app without env CI=true |
without passing IMO until this time, doing like what I wrote in the comment before is perfectly fine. |
Thx for this guys, very helpful. |
Curently have
The text was updated successfully, but these errors were encountered: