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 working on freshly created app #273

Closed
danielantelo opened this issue Jun 22, 2017 · 3 comments
Closed

Tests not working on freshly created app #273

danielantelo opened this issue Jun 22, 2017 · 3 comments

Comments

@danielantelo
Copy link

danielantelo commented Jun 22, 2017

New to react native, was just going to play about with it tonight.
I´ve done the following:

 npm install -g create-react-native-app # this installed 0.0.6
create-react-native-app  myapp

I can run the start and use the iOS app to scan the QR code and I see the "Open up App.js to start..." message on my phone. Cool!

I then tried to do yarn test and I get the following error:

192:myapp daniel$ yarn test
yarn test v0.24.6
$ node node_modules/jest/bin/jest.js --watch 
jest-haste-map: @providesModule naming collision:
  Duplicate module name: react
  Paths: /Users/daniel/Workspace/myapp/node_modules/lottie-react-native/node_modules/react/package.json collides with /Users/daniel/Workspace/myapp/node_modules/xdl/node_modules/react/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: bser
  Paths: /Users/daniel/Workspace/myapp/node_modules/react-native/node_modules/fb-watchman/node_modules/bser/package.json collides with /Users/daniel/Workspace/myapp/node_modules/react-native/node_modules/bser/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: bser
  Paths: /Users/daniel/Workspace/myapp/node_modules/react-native/node_modules/jest-haste-map/node_modules/bser/package.json collides with /Users/daniel/Workspace/myapp/node_modules/react-native/node_modules/fb-watchman/node_modules/bser/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: fb-watchman
  Paths: /Users/daniel/Workspace/myapp/node_modules/react-native/node_modules/jest-haste-map/node_modules/sane/node_modules/fb-watchman/package.json collides with /Users/daniel/Workspace/myapp/node_modules/react-native/node_modules/fb-watchman/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: react
  Paths: /Users/daniel/Workspace/myapp/node_modules/react-native-branch/node_modules/react/package.json collides with /Users/daniel/Workspace/myapp/node_modules/lottie-react-native/node_modules/react/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: react
  Paths: /Users/daniel/Workspace/myapp/node_modules/react-native-fbads/node_modules/react/package.json collides with /Users/daniel/Workspace/myapp/node_modules/react-native-branch/node_modules/react/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
  Duplicate module name: react
  Paths: /Users/daniel/Workspace/myapp/node_modules/react-native-maps/node_modules/react/package.json collides with /Users/daniel/Workspace/myapp/node_modules/react-native-fbads/node_modules/react/package.json

This warning is caused by a @providesModule declaration with the same name across two different files.
2017-06-22 22:09 node[8274] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-06-22 22:09 node[8274] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: Error watching file for changes: EMFILE
    at exports._errnoException (util.js:1016:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1360:11)
error Command failed with exit code 1.

I've not modified any code or configuration. I am using node 8.1.2 and yarn 0.24.6. What can be causing this? do I need to downgrade node or yarn version?

Thanks,

@brentvatne
Copy link
Member

brentvatne commented Jun 24, 2017

hi there!

there are a bunch of warnings there that are gone in the latest version (create a new app to see), the actual error is at the bottom:

2017-06-22 22:09 node[8274] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-06-22 22:09 node[8274] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: Error watching file for changes: EMFILE
    at exports._errnoException (util.js:1016:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1360:11)
error Command failed with exit code 1.

this is a common problem if you don't have watchman installed, check out this thread for the solution: facebook/react-native#10088

@brentvatne
Copy link
Member

actually I will reopen this because we should maybe suggest to jest folks to handle this error better

@danielantelo
Copy link
Author

thanks, I had to install pkg-config first and then watchman:

 brew install pkg-config
 brew install watchman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants