Redirect calls to console.log() to standard output in Jasmine tests(在 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() 的调用重定向到标准输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Jasmine 测试中将对 console.log() 的调用重定向到


- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01