在Jasmine测试中将对console.log()的调用重定向到标准输出 [英] Redirect calls to console.log() to standard output in Jasmine tests

查看:230
本文介绍了在Jasmine测试中将对console.log()的调用重定向到标准输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过jasmine-maven-plugin使用Jasmine,我想在Maven构建输出中看到console.log()消息。有没有办法实现这个?

I'm using Jasmine via the jasmine-maven-plugin, and I would like to see console.log() messages in the Maven build output. Is there a way to achieve this?

如果无法重定向console.log(),是否还有其他方法可以从我的测试中进行记录,以便它们显示在Maven构建输出?

If console.log() cannot be redirected, is there any other way to log from my tests so that they show up on the Maven build output?

我正在以无头的方式在Jenkins上运行这些测试,并希望能够从测试中获得一些调试输出。

I'm running these tests on Jenkins in a headless fashion, and would like a means to get some debug output from the tests.

推荐答案

尝试

console.info('foo')

来自测试javascripts。

From the test javascripts.

这篇关于在Jasmine测试中将对console.log()的调用重定向到标准输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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