Create-react-app: test flags for CI

Created on 10 Mar 2017  路  5Comments  路  Source: facebook/create-react-app

Hi,
You asked to file an issue if I end up doing CI=true a lot...
I use Husky to run my tests before I commit.
For it to work, I use CI=true. I'd like not to run tests that I didn't touch, but can't figure out how to do that.

Thanks!

question

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fson picture fson  路  3Comments

rdamian3 picture rdamian3  路  3Comments

barcher picture barcher  路  3Comments

fson picture fson  路  3Comments

stopachka picture stopachka  路  3Comments