如何禁用Jest`console.log`标签 [英] How to disable Jest `console.log` tags
问题描述
我在内部通过console.log()
完成了一些NodeJS日志记录(实际上是 loglevel ),如我所见,出于任何原因,Jest都用console.log ../path/to/string/with/console.log/call:line#
标记console.log输出:
I have some NodeJS logging done via console.log()
internally (its actually loglevel) and as I see it, Jest tags console.log output with console.log ../path/to/string/with/console.log/call:line#
for whatever reason:
我在文档中没有找到任何相关选项.如何禁用它?
I haven't found any related options in the docs. How can I disable it?
推荐答案
Thanks @Anders Carstensen, I've looked at the answer you mentioned and it says:
查看源代码对于Jest,似乎没有一种巧妙的方法可以关闭这些消息.
Looking at the source code for Jest, it doesn't seem like there is a neat way to turn those messages off.
我不能选择编写自己的控制台,因此我现在只坚持使用Mocha/Sinon.
Not an option for me to write my own console, so I'll just stick with Mocha/Sinon for now.
这篇关于如何禁用Jest`console.log`标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!