jest icon indicating copy to clipboard operation
jest copied to clipboard

getting started example doesn't give a result

Open vasco3 opened this issue 12 years ago • 7 comments

In a fresh start I did:

mkdir test 
cd test/
mkdir __tests__
touch sum.js

Then copied the example https://raw.githubusercontent.com/facebook/jest/master/examples/getting_started/sum.js

touch __tests__/sum-test.js 

copied https://raw.githubusercontent.com/facebook/jest/master/examples/getting_started/tests/sum-test.js

npm install jest-cli --save-dev
npm init

in package.json I made sure I had

"scripts": {
    "test": "jest"
  },
npm test

[email protected] test /vagrant/test jest

Found 1 matching tests... vagrant@precise32:/vagrant/test$

And that's it.. I don't see any failed or success. What's wrong?

vasco3 avatar Jul 12 '14 07:07 vasco3

I'm getting the same thing - On OS X it outputs fine, but on the windows box it does not output anything after the Found 1 matching tests...

gwing33 avatar Jul 17 '14 20:07 gwing33

Ok, so I was using Parallels windows environment, you're using Vagrant, if you open up the src/TestRunner.js and on line 27 it's taking the number of CPUs -1, which in my case was 1-1, so it's not creating any workers.

So, is there a way around this? I can bump my parallels CPUs up to 2, but not sure on the vagrant side?

Edit: Link to file/line number - https://github.com/facebook/jest/blob/master/src/TestRunner.js#L27 Edit 2: Single core servers discrimination.

gwing33 avatar Jul 17 '14 21:07 gwing33

That seems like a bug that should be fixed in Jest.

sophiebits avatar Jul 17 '14 22:07 sophiebits

I just had this exact issue and solved with

"scripts": {
    "test": "jest --maxWorkers=1"
}

jdolitsky avatar Jul 23 '14 16:07 jdolitsky

Now it worked using a new vagrant box hashicorp/precise64 before I was using precise32

vasco3 avatar Jul 24 '14 17:07 vasco3

Hmm, interesting. I also noticed this and was quite frustrated before I found out it was an issue related to Vagrant instead of my setup. Will try to provided solutions and get back.

StephanBijzitter avatar May 09 '16 21:05 StephanBijzitter

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[bot] avatar May 14 '21 10:05 github-actions[bot]