Vows 有一个 run() 方法,可以在 node 下运行测试,无需使用vows
命令。
在https://github.com/cloudhead/vows/blob/master/lib/vows/suite.js中,我们可以看到此方法采用一个选项参数,该参数允许指定除默认值之外的报告器:
this.run = function (options, callback) {
var that = this, start;
options = options || {};
for (var k in options) { this.options[k] = options[k] }
this.matcher = this.options.matcher || this.matcher;
this.reporter = this.options.reporter || this.reporter;
应该在选项对象中传递什么值来选择不同的报告者,例如spec
报告者?