Fix missing mock for StatusBarManager

Summary:
Fix an issue when running Jest unit tests due to a missing mock for StatusBarManger.

**More info:**
In one of my files I have:
```
export const STATUS_BAR_HEIGHT = (StatusBar.currentHeight || 0);
```
When I run the tests it gives this error, which seems to be because StatusBarManager is undefined (https://github.com/facebook/react-native/blob/master/Libraries/Components/StatusBar/StatusBar.js#L20)

```
TypeError: Cannot read property 'HEIGHT' of undefined
  at Object.<anonymous> (node_modules/react-native/Libraries/Components/StatusBar/StatusBar.js:395:1823)
  at Object.StatusBar (node_modules/react-native/Libraries/react-native/react-native.js:55:24)
```

**Test plan (required)**
Verify that with this change tests that use StatusBar pass.
Closes https://github.com/facebook/react-native/pull/11198

Differential Revision: D4246367

Pulled By: cpojer

fbshipit-source-id: ee9406d2566688d235a11cab8f24b0583698e93a
This commit is contained in:
mlanter 2016-11-29 22:05:05 -08:00 committed by Facebook Github Bot
parent 346858a552
commit 39554ab32c
1 changed files with 1 additions and 0 deletions

View File

@ -131,6 +131,7 @@ const mockNativeModules = {
SourceCode: { SourceCode: {
scriptURL: null, scriptURL: null,
}, },
StatusBarManager: {},
Timing: { Timing: {
createTimer: jest.fn(), createTimer: jest.fn(),
deleteTimer: jest.fn(), deleteTimer: jest.fn(),