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

Most upvoted comments

As mentioned in https://github.com/facebook/jest/issues/1767#issuecomment-248883102, can you try running

brew install watchman

?

uninstall watchman fixed!

Another workaround worth trying is to delete /usr/local/var/run/watchman/<USER>-state and try again.