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.

npm test fails if the project doesn't have git

See original GitHub issue

Apparently Jest did this. Oops!

Determining test suites to run...
--watch is not supported without git/hg, please use --watchAll 
npm ERR! Test failed.  See above for more details.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
SimenBcommented, Oct 1, 2018

Note that, unless somebody (probably meaning @mjesun) wants to do some cherry-picking, the next release of Jest will be a major, so any change we make to Jest will most likely not be something CRA can pick up before its next major. So a workaround in CRA makes sense regardless

1reaction
rogeliogcommented, Oct 1, 2018

I agree. From what I’ve been looking at, it seems to be that there was a regression introduced between jest@20.x which is what create-react-app@1.15 uses and jest@22.0.0. This was fixed by providing a better message for the exception, but still exiting with non-zero.

I’m sure @cpojer might provide better insights, but here are my initial thoughts.

  1. Change the behavior in Jest to gracefully handle --watch in non-VCS environments. (Which is how it used to behave.) Probably by just falling back to --watchAll.
  2. Patch CRA to allow --watch to behave as expected.
  3. Release this change in the next Jest release.
  4. Remove the patch in CRA and upgrade Jest
Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM update error - Fails to execute GIT - Stack Overflow
Try configuring your git to use https instead of git. That seems to work more frequently inside work networks.
Read more >
Git error - Fatal: Not a git repository and how to fix it | Datree.io
This error means you attempted to run a Git command, but weren't inside a Git repository. Make sure you've: Navigated to the right...
Read more >
How to Fix the “fatal: not a git repository” Error - ContainIQ
Check that you correctly created the repo. If the directory doesn't contain a .git repo, use git init to properly initialize the repo...
Read more >
Troubleshooting CI/CD - GitLab Docs
If the merge train pipeline has failed, you can: Check the failure and determine if you can use the /merge quick action to...
Read more >
@cypress/github-action - npm
Start using @cypress/github-action in your project by running `npm ... will be generated only if E2E test failed # thus we store screenshots ......
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