Skip to content

ReporterDispatcher set result.console to undefined #8499

@jkblume

Description

@jkblume

🐛 Bug Report

The ReporterDispatcher overrides TestResult.console property with undefined. As a result of this - the console output cannot be used in custom reporters like jest-junit.

To Reproduce

This behaviour is visible in the source code in version @jest core 24.8.0.

Line 43:
https://github.com/facebook/jest/blob/master/packages/jest-core/src/ReporterDispatcher.ts

    // Release memory if unused later.
    testResult.sourceMaps = undefined;
    testResult.coverage = undefined;
    testResult.console = undefined;

Expected behavior

The console output should be forwarded to the test reporters. But first we have to check for what reason the console property is set to undefined.

Link to repl or repo (highly encouraged)

Steps to reproduce the 'error':

If you debug the code or add some debug outputs you notice that the TestResult.console property is defined - but after passing the ReporterDispatcher it is set to undefined

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions