netguru / create-react-app

Create React apps with no build configuration.
MIT License
14 stars 6 forks source link

Do not add --watch option to test script automatically #15

Closed virzen closed 7 years ago

virzen commented 7 years ago

create-react-app adds --watch options to yarn test script automatically, unless running in CI env or --coverage option being present. This is cool, until one wants to use it as git hook. It may be done, using options above, but setting env to CI is a hack and --coverage obfuscates results with long table of files. I propose to disable this behaviour, which is exactly what this PR is doing.

The only downside of this change is necessity to add test:watch script (which I would add myself, if only I knew how to do it).

papermana commented 7 years ago

I think you would add a new script here.

papermana commented 7 years ago

I would prefer to not make breaking changes to people's workflow if it can be avoided. So I'd suggest just using the env variable CI for this purpose (docs). If this feels semantically wrong, maybe just add process.env.GIT_HOOK to the if statement that would get removed here? I'd accept that PR.

For now, I'm closing this one.