听起来您想创建一个自定义的 Jasmine 记者。报告器 API 在Jasmine 文档中进行了解释。
由于您只想对测试结果进行操作,因此您只需要实现specDone
回调即可。你的记者看起来像这样:
var myReporter = {
specDone: function(results)( {
writeToFile('Suite started: ' + result.description + ' whose full description is: ' + result.fullName);
}
};
Run Code Online (Sandbox Code Playgroud)
然后你可以在你的 conf 文件中将你的记者添加到 Jasmine:
jasmine.getEnv().addReporter(myReporter);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
12222 次 |
最近记录: |