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

Tests not running #2219

Closed
zigomir opened this issue Dec 5, 2016 · 19 comments
Closed

Tests not running #2219

zigomir opened this issue Dec 5, 2016 · 19 comments

Comments

@zigomir
Copy link

zigomir commented Dec 5, 2016

I went through getting started but can't get jest to work. I use node v6.9.1, npm v3.10.8 and jest v17.0.3. I also tried --no-cache and --debug but nothing changes. I even moved test to __tests__ dir and renamed it accordingly.

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

  • bug

What is the current behavior?

  • no output, seems like no tests are being ran

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can npm install and npm test.

https://github.com/zigomir/jester

What is the expected behavior?

Test running and passing.

Run Jest again with --debug and provide the full configuration it prints. Please mention your node and npm version and operating system.

Still nothing.

@thymikee
Copy link
Collaborator

thymikee commented Dec 5, 2016

Hi @zigomir, this seems like an issue with npm. I've installed deps with yarn and tests are running. Try removing node_modules and run npm install once again.

If that not helps, could you please try installing your deps with other version of npm, e.g. using npm install -g npm@next. Or you can use yarn if that's not a problem.

@zigomir
Copy link
Author

zigomir commented Dec 5, 2016

I tried yarn myself before opening this issue. I didn't believe npm was that bad. So I ran yarn (v 0.18.0) now in my repo and jest (npm test, npm run tes, yarn run test) still won't run for me. I committed yarn.lock file to the repo mentioned above so you we can be sure to have same dependencies installed.

@thymikee
Copy link
Collaborator

thymikee commented Dec 6, 2016

This is strange. I can still run tests, and they pass when fixing the error, using the same Node version, using either Yarn or npm. Which OS are you on? Have you tried on other machine?

@zigomir
Copy link
Author

zigomir commented Dec 6, 2016

Huh, this is strange. Running now on my VM (Debian) it runs, but not on my host, macOS v10.12.1 :/

@thymikee
Copy link
Collaborator

thymikee commented Dec 6, 2016

I use the same macOS and it works, so this definitely has to be something with your environment. Maybe try to reinstall Node, remove node_modules? It sometimes does the trick ^^

@cpojer
Copy link
Member

cpojer commented Dec 6, 2016

Closing to manage the queue but happy to keep the discussion going and reopen if necessary.

@cpojer cpojer closed this as completed Dec 6, 2016
@zigomir
Copy link
Author

zigomir commented Dec 6, 2016

I figured out jest won't run if i have watchman installed. As soon as I remove it with brew uninstall watchman it works.

I was able to find this out running node_modules/jest/bin/jest.js instead of npm test and iTerm2 printed out watchman in tab title :)

Can you please check if this is the case, I see https://github.com/facebook/watchman is Facebook's repo too ;)

@thymikee
Copy link
Collaborator

thymikee commented Dec 6, 2016

I have watchman installed too (v4.5.0). Probably there was an issue with the version you've been using. Would be great if you installed newer version and try it once more :)

@zigomir
Copy link
Author

zigomir commented Dec 6, 2016

Of course I tried that first. It didn't help. I have a version v4.7.0 installed now and jest won't run.

@cpojer
Copy link
Member

cpojer commented Dec 6, 2016

Check out the bottom of this thread, might be related: #1767

@zigomir
Copy link
Author

zigomir commented Dec 6, 2016

Thanks @cpojer! Yeah this is certainly related to my issue. So stopping watchman with launchctl unload -F ~/Library/LaunchAgents/com.github.facebook.watchman.plist or brew uninstall watchman resolves issue for me. This works for me, glad to be able to use jest now :)

@ryanlindsey
Copy link

ryanlindsey commented Feb 15, 2017

Another Mac OS user here that got bit by this issue, uninstalling watchman allows Jest to run tests.

@AodhanHayter
Copy link
Contributor

Yet another watchman victim, thought for sure I messed up the babel and webpack configuration. Uninstall and all is well.

@smolak
Copy link

smolak commented Oct 4, 2017

Yes, watchman was the culprit. Thanks!!

@babakansari
Copy link

An easy solution to run the tests is with --no-watchman parameter. E.g.
yarn test --u --no-watchman

@Shahor
Copy link

Shahor commented Nov 3, 2017

Another victim of watchman here :(

@finch001
Copy link

finch001 commented Feb 7, 2018

i have the same issue it work with yarn test --u --no-watchman

@mconnor
Copy link

mconnor commented Dec 11, 2018

Upgrading to latest watchman (4.9) worked for me.

pranavkm added a commit to dotnet/aspnetcore that referenced this issue Jan 28, 2019
According to jestjs/jest#2219, jest will
not run tests if watchman is installed. It is not entirely clear if
this is the case in our OSX CI environment, but the symptoms seem close
to what's reported in the issue.

Possible fix for https://github.com/aspnet/AspNetCore-Internal/issues/1619
pranavkm added a commit to dotnet/aspnetcore that referenced this issue Jan 29, 2019
According to jestjs/jest#2219, jest will
not run tests if watchman is installed. It is not entirely clear if
this is the case in our OSX CI environment, but the symptoms seem close
to what's reported in the issue.

Possible fix for https://github.com/aspnet/AspNetCore-Internal/issues/1619
@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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants