Skip to content
Browse files

Mock requireNativeComponent so manual mocking of UIManager properties…

… isn't needed

Fixes warnings such as `Warning: Native component for "RCTView" does not exist` when you don't mock the native view class on `UIManager`.

**Test plan (required)**

Run `npm test` with it and without it, notice that warnings are gone and results are the same.

cc cpojer
Closes #10486

Differential Revision: D4063500

Pulled By: cpojer

fbshipit-source-id: f6bdda1fdd1ad87958f435071d353684cb812af4
  • Loading branch information...
cpojer authored and Facebook Github Bot committed Oct 23, 2016
1 parent 61ddf0e commit 487171fd892416ced6f305a5036464c1dd733ee1
Showing with 10 additions and 0 deletions.
  1. +10 −0 jest/setup.js
@@ -158,3 +158,13 @@ jest
register: id => id,
getByID: () => mockEmptyObject,

jest.doMock('requireNativeComponent', () => {
const React = require('react');

return viewName => props => React.createElement(

0 comments on commit 487171f

Please sign in to comment.
You can’t perform that action at this time.