-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Make the log method in BaseReporter respect the useStderr config option #4296
Comments
I'm willing to submit a PR, just want to know if this would be a desired change. I'm not familiar with the background on why Jest logs to stderr. |
we currently print all reporting to stderr. I was thinking about changing it to stdout, but couldn't justify the change. what's your use case for it? |
The build tool we use to manage our monorepos treats anything logged to the console as a warning. This means a clean build where the tests pass writes to stderr, which we treat as, a 'success with warnings'. When a project gets this build status, we don't cache the result for incremental builds. We think that having our build chain treating stderr logs as warnings is the behavior we want, so we're looking at ways to modify Jest's behavior. We're currently using a custom reporter to prevent Jest from writing to stderr. |
Yeah, I mean |
@christiango if you're willing to submit the PR, one thing that you might expect is that all our integration tests will fail, because they usually read from stderr :) |
I can look into it if you all think it's a worthwhile change. Do you guys have any background on the intent of the |
@christiango it's either |
Would love Jest to print non-failures to stdout. |
i'm working on it right now as part of #4471 |
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. |
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. |
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. |
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
When setting the useStderr option to false, Jest still writes to stderr when there are no test failures. This can currently be worked around by creating a custom reporter that overrides the log method in BaseReporter.
What is the expected behavior?
It would be nice to have BaseReporter respect the useStderr flag so that we don't have to use a custom reporter.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Jest 20.4, npm 5.0.3, Windows Server 2016
The text was updated successfully, but these errors were encountered: