Closed CMCDragonkai closed 2 years ago
See this old issue here for a detailed explanation about why this isn't available. TL;DR jest no longer sends this data to reporters. https://github.com/jest-community/jest-junit/issues/45
I'm confused, in your issue #45 it says it is available. So I'm not just asking about process.stderr
, but I'm asking about console.log
and console.error
. Does console.error
work?
None of them work and haven't for years. If jest fixes the bug then it would work in jest-junit by enabling the "includeConsoleOutput" option.
console.log works with this:
JEST_JUNIT_INCLUDE_CONSOLE_OUTPUT=true npx jest --coverage --reporters=jest-junit
I have tests that tests code that prints log messages to STDERR.
STDERR is the standard way of outputting log messages on unix operating systems.
I'm wondering why
includeConsoleOutput
doesn't affect STDERR.Can we get an option to also include STDERR? Maybe something like
includeConsoleError
?I'd prefer that it also captured
process.stderr.write
, but could settle forconsole.error
.