Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify reporters order and owerwrite coverage/notify reporters #4052

Closed
aaronabramov opened this issue Jul 18, 2017 · 4 comments
Closed

Comments

@aaronabramov
Copy link
Contributor

Custom reporter experience is not great right now and it's pretty hard to customize.
Right now even if we pass this to config:

{reporters: ['custom1.js', 'default', 'custom2.js']}

the order will be:

  • default reporters
  • custom reporters
  • coverage/notify reporters

and that makes it hard to customize reporters that interact with coverage data. (coverage data is never available in custom reporters, because CoverageReporter is always last in the queue).

ideally we need to be able to have a full control over reporters queue.

e.g.

reporters: []

should not have any reporters at all (no coverage, no stdout)

reporters: ['custom1.js', 'default', 'custom2.js']

should run repotrens in the specified order

and

reporters: ['default_reporter.js', 'summary_reporter.js', 'custom_coverage.js']

allows to overwrite and customize specific reporters

@wheeler
Copy link

wheeler commented Nov 6, 2019

I was thinking about writing a reporter that is intended to add grouping markings around the output of an unmodified default reporter. I ran into this issue an impediment - custom always outputs last so I can't inject anything before the summary. I was confused and a few variations but ultimately had to pick around in the source to realize "oh. I can't control the default reporter order with reporters config."

At least I'd suggest a sentence in the doc for reporters config.

My use case is quite simple. I just wanted to add plain bumper text between the sections so that Buildkite would automatically collapse the test running output and expand the summary.

The desired output would look like this:

--- Jest Run Start
(DefaultReporter per-test output)
+++ Jest Run Complete
(SummaryReporter output)

I can only get this.

--- Jest Run Start Group
(DefaultReporter per-test output)
(SummaryReporter output)
+++ Jest Run Complete

@github-actions
Copy link

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

@github-actions github-actions bot added the Stale label Feb 26, 2022
@github-actions
Copy link

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

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants