我已經配置了代碼推送的應用程序,除了笑話測試,它運作良好。它未能在渲染應用此錯誤:代碼推動破解笑話測試反應原生
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 />,
);
});
你需要創建一個[模擬](HTTPS://facebook.github .io/jest/docs/manual-mocks.html)CodePush – Xeijp
codePush varibale未定義或不是json' –
@Assem Chelli是否解決了您的問題?碰到類似自己的東西... –