mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-12 00:25:25 +08:00
36 lines
806 B
JavaScript
36 lines
806 B
JavaScript
import 'react-native';
|
|
import React from 'react';
|
|
import App from '../App';
|
|
|
|
// Note: test renderer must be required after react-native.
|
|
import renderer from 'react-test-renderer';
|
|
|
|
jest.mock('react-native-code-push', () => {
|
|
const cp = (_) => (app) => app;
|
|
Object.assign(cp, {
|
|
InstallMode: {},
|
|
CheckFrequency: {},
|
|
SyncStatus: {},
|
|
UpdateState: {},
|
|
DeploymentStatus: {},
|
|
DEFAULT_UPDATE_DIALOG: {},
|
|
|
|
checkForUpdate: jest.fn(),
|
|
codePushify: jest.fn(),
|
|
getConfiguration: jest.fn(),
|
|
getCurrentPackage: jest.fn(),
|
|
getUpdateMetadata: jest.fn(),
|
|
log: jest.fn(),
|
|
notifyAppReady: jest.fn(),
|
|
notifyApplicationReady: jest.fn(),
|
|
sync: jest.fn(),
|
|
});
|
|
return cp;
|
|
});
|
|
|
|
it('renders correctly', () => {
|
|
const tree = renderer.create(
|
|
<App />
|
|
);
|
|
});
|