测试&持续构建
一. api 测试
- 频繁地将代码集成到主干
- 每次集成都通过自动化的构建来验证
-
优点:
-
- 尽早发现错误
-
- 防止分支大幅度偏离主干
-
工具 egg—— https://github.com/eggjs/egg 持续构建: https://travis-ci.org/eggjs/egg 文档: https://docs.travis-ci.com/
benchmark 性能测试 benchmark.js suite
.add('parseInt()', () => {
num1('123465');
})
.add('Number', () => {
num2('123456');
})
.on('cycle', event => {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').map('name'));
})
.run({async: true});
二. UI 测试
jest
三 爬虫 爬虫: 按照一定的需求自动抓取网络信息 反爬虫:
- user-agent,referer, 验证码
- 单位时间访问次数
- 关键信息用图片混淆
- 异步加载
使用:suppeteer+cheerio
through2, express, koa, egg SSP & 同构 NodeJS 源码