Skip to content

Test Runner: delegate arbitrary output formatting to each reporter #48011

Closed
@MoLow

Description

@MoLow

What is the problem this feature will solve?

The current implementation of the test runner (--test) is very TAP oriented,
so we have decided (#43525 (comment), #45618) to treat any arbitrary output as a test diagnostic.

I do agree this decision makes sense when using TAP as the reporter, but I think we can provide better DX for console logs or other arbitrary output when using other reporters.

What is the feature you are proposing to solve the problem?

add a new event emitted by TestsStream, perhaps test:stdout or test:unknown (or whatever) so each reporter can decide how to treat unknown output.
I think console.log("test") should show the same when running node --test-reporter spec test.js and node --test --test-reporter spec test.js (probably also the same colors etc, but that probably justifies a separate issue)

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions