question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running jest in docker with watch option throw me not supported without git/hg error

See original GitHub issue

Do you want to request a feature or report a bug?

bug

What is the current behavior?

Running with jest --watch in docker exits with --watch is not supported without git/hg, please use --watchAll error.

Running with jest --watchAll could run test successfully, however when I am trying to update snapshot with option u or o it still exits with --watch is not supported without git/hg, please use --watchAll error.

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.

https://github.com/zushenyan/docker-jest-issue

What is the expected behavior?

Running Jest in Docker without errors like local machine.

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

  • docker Version 17.12.0-ce-mac49 (21995)
  • node 8.9.4-alpine
  • jest 22.2.2
  • yarn 1.3.2 (included in node:8.9.4-alpine)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
christopher-franciscocommented, Jul 5, 2018

I have the same problem, but my container DOES have git installed. I even installed watchman on it (built from source) but no luck

2reactions
zushenyancommented, Mar 15, 2018

Actually it was me being silly~

Docker image node:8.9.4-alpine doesn’t come with git or hg utilities.

--watch is not supported without git/hg as this error says, to get Jest work with normal watch mode you will have to install these utilities manually in your image.

For anyone puzzled by this issue please take a look at this branch for solution.

Thank you guys for answering.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running jest in docker with watch option throw me not ...
Running jest in docker with watch option throw me not supported without git/hg error.
Read more >
node.js - Running Jest in --watch mode in a Docker container ...
Without the env vars set, Jest continues to give the error that it can't work without git. I'm assuming it's because git init...
Read more >
Troubleshooting - Jest
Troubleshooting. Uh oh, something went wrong? Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why​.
Read more >
Changelog - Cypress Documentation
Cypress now throws an error if any Cypress commands are invoked from ... Cypress will no longer watch files when executing component tests...
Read more >
How to Fix and Debug Docker Containers Like a Superhero
It's not located in the PATH , which indicates a problem: Running the docker container ls --all command also offers some ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found