create-react-app: Tests hang when running
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
``
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (14 by maintainers)
Commits related to this issue
- Add a note for OSX users about watchman and jest Minor additional information on how to solve watchman problems reported in #713 and #1767 — committed to dmr/create-react-app by dmr 8 years ago
- Introduced new Troubleshooting section Add better explanation how to solve #713 and linked related Issues. — committed to dmr/create-react-app by dmr 8 years ago
- Add a note for OSX users about watchman and jest (#1080) * Add a note for OSX users about watchman and jest Minor additional information on how to solve watchman problems reported in #713 and #176... — committed to facebook/create-react-app by dmr 8 years ago
- Add a note for OSX users about watchman and jest (#1080) * Add a note for OSX users about watchman and jest Minor additional information on how to solve watchman problems reported in #713 and #176... — committed to jarlef/create-react-app by dmr 8 years ago
- Add a note for OSX users about watchman and jest (#1080) * Add a note for OSX users about watchman and jest Minor additional information on how to solve watchman problems reported in #713 and #176... — committed to alexdriaguine/create-react-app by dmr 8 years ago
- Add a note for OSX users about watchman and jest (#1080) * Add a note for OSX users about watchman and jest Minor additional information on how to solve watchman problems reported in #713 and #176... — committed to CodingZeal/create-react-app by dmr 8 years ago
As mentioned in https://github.com/facebook/jest/issues/1767#issuecomment-248883102, can you try running
?
uninstall watchman fixed!
Another workaround worth trying is to delete
/usr/local/var/run/watchman/<USER>-state
and try again.