小编Vin*_*nay的帖子

react-native-tab-view 的 Jest 单元测试

有没有人为 react-native-tab-view 编写过单元测试?我需要模拟道具 onIndexChanged 和 TabBar 的 getLabelText。这是我们的模拟

import React from 'react';
import { View } from "react-native";

export class TabView extends View {
    render = function () {
        return <View>
            {this.props.renderTabBar()}
            {Object.values(this.props.renderScene)
                .map((scene, i) => <View key={i}>{scene()}</View>)}
        </View>;
    };
};

export const TabBar = View;
export const SceneMap = map => map;



Here is the TabView we are using. Any help is really appreciated. 
Run Code Online (Sandbox Code Playgroud)

 <TabView
          navigationState={this.state}
          renderScene={SceneMap({
            current: () => <TorViewCurrent
              torCurrentList={this.props.torCurrentList}
              torCurrentListLoading={this.props.isLoading || this.props.torCurrentListLoading}
              torCurrentListLoaded={this.torCurrentListLoaded}
              torCurrentListError={this.props.torCurrentListError}
              torStatusMap={this.props.torStatusMap}
              torReasonMap={this.props.torReasonMap} …
Run Code Online (Sandbox Code Playgroud)

jestjs react-native enzyme

7
推荐指数
0
解决办法
910
查看次数

反应本地WiFi列表

有没有一种方法可以使用Android和iOS的本机反应进行扫描并全部获取Wifi列表。我看过一些库,但大多数是android库,甚至那些库也无法正常工作。有什么建议么?

如果我需要编写本机模块,可以为我指出正确的方向。以前从未写过React Native的本地模块。

list wifi react-native native-module

6
推荐指数
1
解决办法
4979
查看次数

标签 统计

react-native ×2

enzyme ×1

jestjs ×1

list ×1

native-module ×1

wifi ×1