When I run npm test from a stock setup of v1.0.0, I get an error about jest-haste-map duplicate manual mock found.
I expected npm test to run without any issues.
An uncaught error was thrown during the test.
➜ SampleReactNative npm test
> [email protected] test /Users/andy/Code/src/github.com/enozero/SampleReactNative
> node node_modules/jest/bin/jest.js --watch
jest-haste-map: duplicate manual mock found:
Module name: ErrorUtils
Duplicate Mock path: /Users/andy/Code/src/github.com/enozero/SampleReactNative/node_modules/react-native/node_modules/fbjs/lib/__mocks__/ErrorUtils.js
This warning is caused by two manual mock files with the same file name.
Jest will use the mock file found in:
/Users/andy/Code/src/github.com/enozero/SampleReactNative/node_modules/react-native/node_modules/fbjs/lib/__mocks__/ErrorUtils.js
Please delete one of the following two files:
/Users/andy/Code/src/github.com/enozero/SampleReactNative/node_modules/react-native/Libraries/Core/__mocks__/ErrorUtils.js
/Users/andy/Code/src/github.com/enozero/SampleReactNative/node_modules/react-native/node_modules/fbjs/lib/__mocks__/ErrorUtils.js
2017-07-26 22:54 node[34328] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-07-26 22:54 node[34328] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:160
throw er; // Unhandled 'error' event
^
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1018:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1420:11)
npm ERR! Test failed. See above for more details.
npm ls react-native-scripts: [email protected]npm ls react-native: [email protected]npm ls expo: [email protected]npm ERR! peer dep missing: react@>=15.3.1, required by [email protected]
npm ERR! peer dep missing: react@>=15.4.0, required by [email protected].
node -v: v6.11.1npm -v: 3.10.10yarn --version: command not found: yarnwatchman version: command not found: watchmanAlso specify:
hello! the warning that you're seeing is a red herring -- the actual error comes later:
2017-07-26 22:54 node[34328] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-07-26 22:54 node[34328] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:160
throw er; // Unhandled 'error' event
^
Error: Error watching file for changes: EMFILE
a good way to get around this error is to install watchman. see: https://github.com/facebook/react-native/issues/10028. also, read more about the error here if you're curious
also, i published jest-expo 19.0.2 which resolves the warning (it was harmless but annoying)
cc @fson - maybe we should watch for this error and provide a more useful message.
@brentvatne I have just the same warning, but without any errors. The tests are also running fine. Could this be another issue?
yarn test v0.27.5
$ jest
jest-haste-map: duplicate manual mock found:
Module name: ErrorUtils
Duplicate Mock path: /Users/suhairzain/Documents/xx/app/node_modules/react-native/node_modules/fbjs/lib/__mocks__/ErrorUtils.js
This warning is caused by two manual mock files with the same file name.
Jest will use the mock file found in:
/Users/suhairzain/Documents/xx/app/node_modules/react-native/node_modules/fbjs/lib/__mocks__/ErrorUtils.js
Please delete one of the following two files:
/Users/suhairzain/Documents/xx/app/node_modules/react-native/Libraries/Core/__mocks__/ErrorUtils.js
/Users/suhairzain/Documents/xx/app/node_modules/react-native/node_modules/fbjs/lib/__mocks__/ErrorUtils.js
(...PASS message for 13 tests)
Test Suites: 13 passed, 13 total
Tests: 29 passed, 29 total
Snapshots: 0 total
Time: 4.617s
Ran all test suites.
Done in 5.93s.
@SuhairZain see facebook/jest#2070
Most helpful comment
@SuhairZain see facebook/jest#2070