`includeConsoleLog: true` doesn't report console output for tests
See original GitHub issueSetup: Package.json
"devDependencies": {
"stuff": "stuff",
"jest": "23.3.0",
"jest-html-reporter": "^2.4.2"
},
"jest": {
"reporters": [
"default",
[
"./node_modules/jest-html-reporter",
{
"pageTitle": "Test Report",
"includeFailureMsg": true,
"includeConsoleLog": true,
"outputPath": "report/index.html"
}
]
]
}
Console output:
console.log apiAgent.js:17
Requesting: GET to: /api/cs/v2/resolver?text=Butt%20pain;%20can%E2%80%9A%C3%84%C3%B4t%20lie%20down
(this is a passing test)
console.log apiAgent.js:17
Requesting: GET to: /api/cs/v2/resolver?text=neck
(this is a failing test)
console.log apiAgent.js:27
Receive body: <html><head><title>Apache Tomcat/7.0.84 - Error report</title><style><!-
The html output only shows:
Test GET endpoint | Test passing one: | passed in 0.115s
-- | -- | --
Test GET endpoint | Test failing one: neckError: expect(received).toBe(expected) // Object.is equality
No mention of logs on the output
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Console.log statements output nothing at all in Jest
Run console.debug('Message here', yourValueHere) inside test function and it should show in the console output when running test script. You can verify if ......
Read more >How to view log output while tests are running in VS 2019 ...
My goal is to view log output in Visual Studio 2019 Pro, for all unit tests, while the tests are running. I tried...
Read more >JavaScript Console.log() Example – How to Print to the ...
Just open the console, Ctrl+Shift+K or F12 , and in the top right you will see a button that says "Switch to multi-line...
Read more >Console | Node.js v19.3.0 Documentation
A Console class with methods such as console.log() , console.error() , and console.warn() that can be used to write to any Node.js stream....
Read more >Capturing Output > xUnit.net
Capturing output in unit tests; Capturing output in extensibility classes. If you used xUnit.net 1.x, you may have previously been writing output to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same issue here.
Uhm… I just want to see all console output related to a test suit. So I guess getting basic
console.log
output is not possible?Debugging
jest
tests has been a mess from the start. Because of it’s “(pseudo-)multi-threaded nature”,console.log
calls appear in confusing order and sometimes get swallowed whole. I was hoping that this plugin would sort the correspondinglog
calls to the corresponding tests, but I guess that would not be easily achievable. I guess it is time for a properjest
logging tool (Googling that only yields the problems withconsole.log
)… 😕Ooh. Well yes the console.log is in the test file 😕.
Do you know a way to be able to have those console.log pass to the reporter (those made in spec files) ?