Node.js??UnitTest???????
???????????? ???????[ 2014/7/3 13:34:49 ] ???????????????
????????????????????????У??????????????????????UnitTest???????. Node.js??built-in??Assert?? ?????????????Node.js?????????????????????nodeunit??
???????NPM?????
????npm install nodeunit -g
????????????У??????????. ???????? ??node.js????黯???????????exports?? ??????????module.exports???????????????????????????node.js????
var fs = require('fs')??
global=require('./global.js');
var utils = {
startWith: function(s1?? s) {
if (s == null || s == "" || this.length == 0 || s.length > this.length)
return false;
if (s1.substr(0?? s.length) == s)
return true;
else
return false;
return true;
}??
/* Generate GUID */
getGuid: function() {
var guid = "";
for (var i = 1; i <= 32; i++) {
var n = Math.floor(Math.random() * 16.0).toString(16);
guid += n;
}
return guid;
}??
/* add log information */
writeLog: function(log) {
if(!log) return;
var text = fs.readFileSync(global.logFile?? "utf-8")??
_newLog = text ? (text + "
" + log) : log;
fs.writeFile(global.logFile?? _newLog?? function(err){
if(err) throw err;
});
}
};
exports.utils=utils;
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
iOS???????mocha??chai??sinon??istanbul???????????????????????????????????????д?????Java????????7??????Android?????????Robolectric3.0????(?)???Kiwi?????????????????????????????????Python?????????????????????????????????????Controller????????д?????????10???????????????????Angular????????????Component??Directive??Pipe ???ServiceAndroid????????????????????????????????--Mockito??????iOS UnitTest???????Vue?????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????