benoitvallon / react-native-nw-react-calculator

Mobile, desktop and website Apps with the same code
MIT License
5.21k stars 864 forks source link

`npm test` fails with naming collision #23

Closed jwhitley closed 8 years ago

jwhitley commented 8 years ago

Repro steps:

  1. git clone https://github.com/benoitvallon/react-native-nw-react-calculator
  2. cd react-native-nw-react-calculator
  3. npm install
  4. npm install (again, per discussion in #3)
  5. npm test

Actual results:

koi:✓:react-native-nw-react-calculator>> npm test

> ReactNativeNWReactCalculator@1.0.0 test /Users/whitley/src/3p/react-native-nw-react-calculator
> jest

Using Jest CLI v0.9.0, jasmine2

Error: Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: xhrSimpleDataSerializer
  Paths: /Users/whitley/src/3p/react-native-nw-react-calculator/node_modules/react-native/node_modules/fbjs/lib/xhrSimpleDataSerializer.js collides with /Users/whitley/src/3p/react-native-nw-react-calculator/node_modules/flux/node_modules/fbjs/flow/include/xhrSimpleDataSerializer.js

This error is caused by a @providesModule declaration with the same name accross two different files.

This is most likely a setup or configuration issue. To resolve a module name collision, change or blacklist one of the offending modules. See http://facebook.github.io/jest/docs/api.html#config-modulepathignorepatterns-array-string
npm ERR! Test failed.  See above for more details.

I've tried to repro with both node v5.5.0 (npm v3.3.12) and node v5.7.0 (npm v3.6.0), with the same error each time.

FWIW, I ended up here after having similar naming collision errors plaguing my attempts to bring up jest-based tests in a new RN project I'm working on. (BTW, thanks a LOT for including tests here. Very few public RN projects seem to bother.) I'm at a loss as to what could be causing this, aside from it being at least superficially related to facebook/react-native#3625 and facebook/react-native#3618. But those have been hanging around for some time, meanwhile the discussion on issues and PRs here suggest that the tests have been running well for you and others.

Any ideas?

benoitvallon commented 8 years ago

Yes, I know :) I am waiting for travis to finish the tests but it is already fixed. I will merge as soon as the tests will be finished.

Thanks for your issue.

jwhitley commented 8 years ago

@benoitvallon Wonderful, thanks!

benoitvallon commented 8 years ago

The code is pushed