Create-react-app: Export CI=true does not execute tests in batch mode

Created on 12 Dec 2016  ·  7Comments  ·  Source: facebook/create-react-app

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Description

Trying to execute test in CI environment.

Expected behavior

Tests should run and immediately terminate.

Actual behavior

Tests run, but wait for changes/user input.

Environment

npm ls react-scripts
[email protected] /Users/gulli/src/ru/reference-tictactoe-student/client
└── [email protected]

node -v
v6.9.1

npm -v
4.0.3

Then, specify:

OSX Sierra
Browser irrelevant.

Reproducible Demo

clone https://github.com/hgop/reference-tictactoe
cd client
npm install
export CI=true
npm test

Should run tests and exit immediately since CI variable is true according to docs here:

https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#continuous-integration

Most helpful comment

I see you have --watchAll in your test command, it probably overrides CI=true.

All 7 comments

@stefaneg thanks for the issue!

The CI variable was introduced in react-scripts v0.8.0, so please try upgrading.

Hmm I think CI variable itself was supported since we added the test runner.

Still does not work for me. Tried 0.8.0 and 0.8.4.

[email protected] /Users/gulli/src/ru/reference-tictactoe-student/client
└── [email protected]

I'm getting the information that this is working for some of my students. I'll post an update when I know more details.

I see you have --watchAll in your test command, it probably overrides CI=true.

Yeah, my mistake.

Yeah, I just realized that. Thank you guys.

Glad it's solved, sorry again for leading you slightly astray :)

Was this page helpful?
0 / 5 - 0 ratings