本文介紹了在 Jasmine 測試中將對 console.log() 的調用重定向到標準輸出的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我通過 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() 的調用重定向到標準輸出的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!