单元测试(测试function,输入为参数): Mocha.js(浏览器/nodejs)、Jasmine(浏览器)
PhontomJS
var page = require('webpage').create();
page.open('http://some.org', function (status) { // 打开目标网页
console.log(status); // 用console 或 其他日志工具 记录测试报告
phantom.exit();
});
单元测试(测试function,输入为参数): Mocha.js(浏览器/nodejs)、Jasmine(浏览器)