如何测试,以获得100%的开玩笑覆盖率
// @flow
import { AppRegistry } from 'react-native'
import App from './src/App'
AppRegistry.registerComponent('app', () => App)
这类文件是'index.ios.js'和'index.android.js'
答案 0 :(得分:0)
新的React Native安装附带的默认测试应该按原样执行。
import 'react-native';
import React from 'react';
import Index from './index.PLATFORM.js';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
const tree = renderer.create(
<Index />
);
});