将茉莉花测试结果输出到控制台 [英] Output jasmine test results to the console

查看:190
本文介绍了将茉莉花测试结果输出到控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在我的Firefox插件中使用Jasmine(JavaScript的BDD测试框架)来测试我的代码的功能。



问题是,茉莉花是测试结果输出到一个HTML文件,我需要的是萤火虫控制台或其他解决方案输出结果。

解决方案

您是否尝试过 ConsoleRepoter

  jasmine.getEnv()。addReporter (new jasmine.ConsoleReporter(console.log)); 


$ b

根据Jasmine的代码,ConsoleReporter类执行一个打印函数(在本例中为console.log ),应该做你所需要的。



如果一切都失败了,你可以用这个作为起点来实现你自己的console.log记者。 b $ b


I am using Jasmine (BDD Testing Framework for JavaScript) in my firefox add-on to test the functionality of my code.

The problem is that jasmine is outputing the test results to an HTML file,what I need is to Firebug Console or other solution to output the results.

解决方案

Have you tried the ConsoleRepoter

jasmine.getEnv().addReporter(new jasmine.ConsoleReporter(console.log));

According to the code Jasmine has the ConsoleReporter class that executes a print function (in this case console.log) that should do what you need.

If all else fails you could just use this as a starting point to implement your own console.log reporter.

这篇关于将茉莉花测试结果输出到控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆