Closed
Description
I have a test like this:
test('renders without crashing', () => {
// const div = document.createElement('div');
// ReactDOM.render(<App />, div);
expect(true).toBe(true)
});
when I run it, with npm t
it hangs. here is the output
→ npm t --loglevel=silly
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/6.6.0/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 't',
npm verb cli '--loglevel=silly' ]
npm info using npm@3.10.7
npm info using node@v6.6.0
npm verb run-script [ 'pretest', 'test', 'posttest' ]
npm info lifecycle reg-dashboard@0.1.0~pretest: reg-dashboard@0.1.0
npm sill lifecycle reg-dashboard@0.1.0~pretest: no script for pretest, continuing
npm info lifecycle reg-dashboard@0.1.0~test: reg-dashboard@0.1.0
> reg-dashboard@0.1.0 test /Users/luizeduardo/js_dev/reg-dashboard
> react-scripts test --env=jsdom
I'm running macOS Sierra with.
I can reproduce it with a new app as well.
the react-scripts:
→ npm ls react-scripts
reg-dashboard@0.1.0 /Users/luizeduardo/js_dev/reg-dashboard
├── react-scripts@0.4.1
``
Activity
gaearon commentedon Sep 23, 2016
By "hangs" do you mean that interactive watcher never appears?
gaearon commentedon Sep 23, 2016
As mentioned in jestjs/jest#1767 (comment), can you try running
?
luizkowalski commentedon Sep 23, 2016
@gaearon yes, as the log above, I see
> react-scripts test --env=jsdom
as the last output, and nothing else happens. I tried edit the test files, change the__tests__
folder location, or have just one simple test likeexpect(true).toBe(true)
I do have watchmen installed, btw.
gaearon commentedon Sep 23, 2016
I meant to run this command to update it to 4.7.0 (as explained in jestjs/jest#1767 (comment)).
luizkowalski commentedon Sep 23, 2016
I do have watchmen 4.7.0 installed
gaearon commentedon Sep 23, 2016
I see. Can you reproduce this on any other computer (with or without Sierra)?
gaearon commentedon Sep 23, 2016
I think it would be best if you shared your report in jestjs/jest#1767 to provide more context around this issue.
gaearon commentedon Sep 23, 2016
It’s also worth trying to uninstall watchmen and seeing if that fixes the issue.
luizkowalski commentedon Sep 23, 2016
uninstall watchman fixed!
gaearon commentedon Sep 23, 2016
Can you try to install it again now and see if the problem persists? If it does, please also try suggestions in jestjs/jest#1767 (comment) and let us know if either worked.
luizkowalski commentedon Sep 23, 2016
Just did, yes, the problem persists if I reinstall.
gaearon commentedon Sep 23, 2016
Does doing this help?
(and then run tests)
3 remaining items
luizkowalski commentedon Sep 23, 2016
Hey, sorry for the delay.
No, unload didn't worked for me, anyway.
Thanks!
gaearon commentedon Sep 24, 2016
I’d appreciate if you could report this upstream to Jest or watchman.
dmr commentedon Nov 20, 2016
I ran into this and it took me a while to find this issue. --> Can we mention this in the docs somewhere?
gaearon commentedon Nov 20, 2016
Sure, a PR to the User Guide with troubleshooting steps would be welcome.
gaearon commentedon Nov 20, 2016
A few other reported ways to fix it:
Add a note for OSX users about watchman and jest
Introduced new Troubleshooting section
Add a note for OSX users about watchman and jest (#1080)
Add a note for OSX users about watchman and jest (facebook#1080)
Add a note for OSX users about watchman and jest (facebook#1080)
Add a note for OSX users about watchman and jest (facebook#1080)