jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
44.05k stars 6.44k forks source link

[Feature]: Provide console logs per testcase to reporter #15180

Closed cgrabmann closed 4 days ago

cgrabmann commented 2 months ago

🚀 Feature Proposal

Either provide logs of test-case in TestCaseResult or make the information about the test-case where the log was created available in the LogEntry of TestResult.

Motivation

Currently the console buffer is sent to a reporter with the TestResult. This information is not very useful in cases where you want to group the logs per test-case.
It also does not seem trivial to map logs back to test-cases since the LogEntry only contains a complete stacktrace on where the log was sent from and no information during which test-case it was sent.

Because of this it's impossible without some hacks to identify the logs per test-case and report them to some external tool like https://github.com/reportportal/agent-js-jest/issues/55.

Example

No response

Pitch

This enables reporters to give better context to test-execution reports.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 4 days ago

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] commented 4 days ago

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.