Jest: "--watch not supported without git/hg" when running with no pattern

Created on 5 Mar 2018  路  6Comments  路  Source: facebook/jest

Do you want to request a _feature_ or report a _bug_?
bug

What is the current behavior?
Run tests with 'watchAll', hit 'p' to enter a pattern, hit 'return' with no pattern, get error and exit: "--watch is not supported without git/hg, please use --watchAll"

screenshot

If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.

Make sure there is not git/hg file. Load any tests in watchAll mode with watchman. Same steps as above.

What is the expected behavior?
As per Jest v20, should re-run all tests with original command (watchAll).

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

Jest: 22.4.2
Node: 8.9
Yarn: 1.3.2
MacOS

Most helpful comment

you need execute git init. Works for me

All 6 comments

Hey @alexgurr, thanks for using Jest. We do not support watch mode outside of git/hg

See https://github.com/facebook/jest/issues/5049 and https://github.com/facebook/jest/pull/5060

I thought watchAll was for projects outside of git/hg?

Ah sorry, misread!

Is this a dupe of https://github.com/facebook/jest/issues/5551 then?

Yes it is, mine isn't running in docker though. Probably why I couldn't find that issue when I searched.

you need execute git init. Works for me

image

you need execute git init. Works for me
He was right

Was this page helpful?
0 / 5 - 0 ratings