Summary:
**Description**

In the same vein as https://github.com/facebook/react-native/pull/11198, this adds a mock for the native module `AppState`.

**Test plan**

Create a component that uses `AppState`, e.g.

```jsx
import React, { Component } from 'react';
import { AppState } from 'react-native';

class TestComponent extends Component {
  componentDidMount() {
    AppState.addEventListener('change', this.stateChangeListener);
  }
}
```
Closes https://github.com/facebook/react-native/pull/11199

Differential Revision: D4246668

Pulled By: cpojer

fbshipit-source-id: e3a73a98963a0e152a70aba78ef3461b86da0f6c
This commit is contained in:
Kevin Cooper 2016-11-29 14:39:28 -08:00 коммит произвёл Facebook Github Bot
Родитель 20e99f5b93
Коммит 00f888a318
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -70,6 +70,9 @@ const mockNativeModules = {
AlertManager: {
alertWithArgs: jest.fn(),
},
AppState: {
addEventListener: jest.fn(),
},
AsyncLocalStorage: {
clear: jest.fn(),
getItem: jest.fn(),