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

Provide option to suppress test failure output #5358

Closed
theoutlander opened this issue Jan 21, 2018 · 9 comments
Closed

Provide option to suppress test failure output #5358

theoutlander opened this issue Jan 21, 2018 · 9 comments

Comments

@theoutlander
Copy link

theoutlander commented Jan 21, 2018

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
When a test fails, the console output displays details about the code/line where the test failed. This is expected.

When I use silent/verbose, it appears to suppress everything else, except test failures.

What is the expected behavior?
It would be nice to be able to suppress the specifics of the test failure so the report will only show a pass/fail summary. I think this could be achieved via a custom reporter, but I feel that it would be appropriate as a core feature.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

Node 8.9.1
Jest 22.0.4
Npm 5.6.0

@SimenB
Copy link
Member

SimenB commented Jan 23, 2018

I think that's fair. PR welcome! 🙂

@theoutlander
Copy link
Author

@SimenB Do you think a new option/parameter should be introduced for this or should this be a part of the silent option? The latter will change the existing behaviour though.

@SimenB
Copy link
Member

SimenB commented Jan 23, 2018

Separate, I think. We can maybe merge them in a later major release if need be

@cpojer
Copy link
Member

cpojer commented Feb 27, 2018

See the comment to the PR. This is something that would be better handled by a custom reporter.

@cpojer cpojer closed this as completed Feb 27, 2018
@rickhanlonii
Copy link
Member

@theoutlander I'm up for adding this as a flag for jest-silent-reporter if you want to open a request there

@theoutlander
Copy link
Author

@rickhanlonii sorry for the delayed response. I completely missed this comment amongst millions of notifications.

What is the purpose of jest-silent-reporter? Are you saying that introducing that flag will provide the desired behavior?

@rickhanlonii
Copy link
Member

jest-silent-reporter is a custom reporter that only outputs the failed tests, I'm up for adding a flag to that reporter to only show the file names instead of the full diff

Also see #3322

@sunfit
Copy link

sunfit commented Jan 10, 2019

Hey, so I ran in to the same issue and could not find a solution through google, so I ended up writing my own reporter jest-summarizing-reporter.

Only when time came to publish to npm did I find out that at least 3 packages with same functionality already exist npm search results for jest summary reporters

If anyone finds this thread in same situation as I did, I hope this helps you.

P.S. I agree with OP that achieving this result should be possible without a custom reporter.

@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 May 12, 2021
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

5 participants