听起来您想创建自定义的Jasmine报告程序。Jasmine docs中说明了报告程序API 。
由于您只想处理测试结果,因此只需要实现specDone
回调即可。您的记者看起来像这样:
var myReporter = {
specDone: function(results)( {
writeToFile('Suite started: ' + result.description + ' whose full description is: ' + result.fullName);
}
};
然后,您可以在conf文件中将记者添加到Jasmine中:
jasmine.getEnv().addReporter(myReporter);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句