Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"--watch not supported without git/hg" when running with no pattern #5725

Closed
alexgurr opened this issue Mar 5, 2018 · 8 comments
Closed

Comments

@alexgurr
Copy link

alexgurr commented Mar 5, 2018

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

@rickhanlonii
Copy link
Member

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

See #5049 and #5060

@alexgurr
Copy link
Author

alexgurr commented Mar 5, 2018

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

@rickhanlonii
Copy link
Member

Ah sorry, misread!

Is this a dupe of #5551 then?

@alexgurr
Copy link
Author

alexgurr commented Mar 5, 2018

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

@yasser17
Copy link

yasser17 commented Jun 11, 2018

you need execute git init. Works for me

@noenif
Copy link

noenif commented Sep 22, 2020

image

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

@kerren
Copy link

kerren commented Jan 16, 2021

For me, the git init command didn't work because I was running this inside a Docker container. The answer in this post https://stackoverflow.com/questions/60768371/running-jest-in-watch-mode-in-a-docker-container-in-a-subdirectory-of-git-root got it working. I had to set the GIT_WORK_TREE and GIT_DIR environment variables to get it working.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants