npm error: --watch is not supported without git/hg, please use --watchAll #282
Description
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes.
Environment
npm ls react-scripts-ts
: [email protected]node -v
: v9.7.0npm -v
: 5.7.1os
: macOS 10.13.1
Steps to Reproduce
- Install new project as described in README:
create-react-app my-app --scripts-version=react-scripts-ts
. - Execute
npm run test
- After cleaning the terminal screen as expected an npm task error is shown and no test is being carried out. Below is shown the issue message.
Determining test suites to run...
--watch is not supported without git/hg, please use --watchAll
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `react-scripts-ts test --env=jsdom`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Expected Behavior
No error happen and tests are executed.
Actual Behavior
When running the command described above, the test script is having the mentioned error. This error happens only under a npm context. When running the script directly on terminal only the warning message is shown but still no test is executed.
$ ./node_modules/.bin/react-scripts-ts test --env=jsdom
Determining test suites to run...
--watch is not supported without git/hg, please use --watchAll
This same issue is not happening in base project react-scripts.
After struggling a bit why it is happening I've come across test.js
file where is being carried the testing operation. I've just replaced --watch
by --watchAll
as indicated in the message returned. The next execution was successful.
Intrigued if this change has being done in react-scripts project, I've found the test.js
file differs from the current project from line 24. The interesting part is where this option is attached. It is still passing the same --watch
and not the --watchAll
as the message warns.
So, I don't know if this change I'm pointing out must be the proper fix.
Please have a look when you have time. Thanks.