我已经为Code-push配置了一个应用程序,除了jest测试之外,它运行良好。在渲染应用程序时出现错误,导致测试失败:
TypeError: Cannot read property 'CheckFrequency' of undefined
at Object.<anonymous> (app/index.js:7:66)
at Object.<anonymous> (index.ios.js:5:12)
at Object.<anonymous> (__tests__/index.ios.js:4:12)
在这一行中:
const codePushOptions = { checkFrequency: codePush.CheckFrequency.MANUAL };
测试代码如下:
import App from '../index.ios';
it('renders correctly', () => {
const tree = renderer.create(
<App />,
);
});