Create-react-app: Alpha 3.0.0-next.68 test --coverage enters watch mode

Created on 17 Apr 2019  路  5Comments  路  Source: facebook/create-react-app

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes.

yarn --version:
1.15.2

Which terms did you search for in User Guide?

alpha test --coverage enters watch mode

Environment

Environment Info:

System:
OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver)
CPU: x64 Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz
Binaries:
Node: 10.15.3 - /usr/bin/node
Yarn: 1.15.2 - /usr/bin/yarn
npm: 6.4.1 - /usr/bin/npm
Browsers:
Chrome: 73.0.3683.103
Firefox: 66.0.3
npmPackages:
react: ^16.8.6 => 16.8.6
react-dom: ^16.8.6 => 16.8.6
react-scripts: 3.0.0-next.68 => 3.0.0-next.68+4b5b76b7
npmGlobalPackages:
create-react-app: 1.5.2

Steps to Reproduce

In terminal

npx create-react-app@next --scripts-version=3.0.0-next.68 app-name 
cd app-name
yarn test --coverage

Check terminal output

Expected Behavior

Run a jest test coverage report.

Actual Behavior

Looks like it is doing a coverage report, but seems to enter jest watch mode.

image

Reproducible Demo

https://github.com/jkdowdle/creact-react-app-3.0.0-next.68-test-coverage-issue

bug

Most helpful comment

Hi @jkdowdle, Thanks for testing the latest alpha.
This is an intentional change. jest did not support watch mode and coverage at the same time last year, so the previous behavior of yarn test --coverage did not run in watch mode.

Now that jest supports --coverage flag in watch mode, the following behaviors are supported by default:
yarn test --coverage which runs jest in watch mode and prints coverage of the touched files
yarn test --coverage --watchAll=false which runs jest in non-watch mode and prints coverage of all files.

All 5 comments

Likely related to this change: #4176

Hi @jkdowdle, Thanks for testing the latest alpha.
This is an intentional change. jest did not support watch mode and coverage at the same time last year, so the previous behavior of yarn test --coverage did not run in watch mode.

Now that jest supports --coverage flag in watch mode, the following behaviors are supported by default:
yarn test --coverage which runs jest in watch mode and prints coverage of the touched files
yarn test --coverage --watchAll=false which runs jest in non-watch mode and prints coverage of all files.

In addition what @bugzpodder said the watch mode is disabled in CI so it should be a fairly safe change

@bugzpodder @petetnt

Oh ok I didn't realize that was a feature Jest would introduce. But if this is expected behavior, awesome!

I will close the issue. Appreciate the quick responses on this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  路  3Comments

jnachtigall picture jnachtigall  路  3Comments

Evan-GK picture Evan-GK  路  3Comments

ap13p picture ap13p  路  3Comments

fson picture fson  路  3Comments