Closed brainee closed 5 years ago
@brainee
我把你的代码替换至测试文件case_javascript.js
下能正常跑通Full test-Javascript
部分,代码19、20行也能正常隐藏。
如果之前你在本地自行测试的话,请注意每个测试文件会导出两个常量。其中一个为C_JS
,代表测试用例;另一个为R_JS
,代表预期结果。你需要将C_JS
中的代码替换为自己的代码,同时需要将预期的结果替换至R_JS
的之中。在黏贴代码时需要注意多余的末尾空行,因为preprocessor不会处理空行,在测试比对时可能会导致报错。
p.s. 友情提醒,提交Issue时请关注下代码格式。
'use strict';
import React, { Component } from 'react'; import { StyleSheet, Text, View, MapView, TouchableHighlight, TouchableOpacity, ScrollView, ListView } from 'react-native';
// import test from 'test'; // console.log('test', test);
let a = 1; // ...this line may be omitted. // #!debug a=2; console.log("-----------a=",a);
const localAssets = { // iconArrow: require('navigator/asset/icon_arrow.png'), // iconArrow: require('../asset/icon_arrow.png'), }; // let lazyModule =lazyRequire('./Page2.js'); // lazyModule.onModuleLoaded(function (module) { // console.log('3@@@@@@@@@@@@@@@@@@@',module); // }); // // setTimeout(function(){ // let module = lazyModule.load(); // console.log('4@@@@@@@@@@@@@@@@@@@',module); // // }, 3000);
let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => { return (r1.titleExtend != r2.titleExtend || r1.bizType != r2.bizType || r1.isFavoriteExtend !== r2.isFavoriteExtend) }, sectionHeaderHasChanged: (s1, s2) => { return s1 !== s2 }, getSectionHeaderData: (dataBlob, sectionID) => { return DataManage.getSectionHeaderName(sectionID); } });
export default class Page1 extends Page { constructor(props) { super(props); this.state = { dataSource: ds.cloneWithRows(['John', 'Joel', 'James', 'Jimmy', 'Jackson', 'Jillian', 'Julie', 'Devin', "9", "10", "11 "]), // dataSource: ds.cloneWithRowsAndSections(['John', 'Joel', 'James', 'Jimmy', 'Jackson', 'Jillian', 'Julie', 'Devin']), loadState: 'normal', // 加载状态 normal-默认、loading-加载中、failed-加载失败、done-加载完成 };
}
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, button: { "backgroundColor": "red" }, fillStyle: { backgroundColor: 'red' }, backgroundStyle: { backgroundColor: 'orange', borderRadius: 1 }, ProgressBar1: { "marginTop": 20, "width": 200 } });