Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements proper separation of error output to stderr while keeping normal output on stdout. It adds a new stderr method to the logger that wraps console.error(), enabling test frameworks and CI/CD systems to distinguish between test results and error messages more effectively.
Key Changes
- Added
logger.stderr()method that outputs to stderr viaconsole.error() - Migrated all error-related output (error messages, stack traces, code frames, failing test summaries) to use
logger.stderr()instead oflogger.log() - Updated test helpers to include
expectStderrLog()for verifying error messages in stderr stream
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/utils/logger.ts | Renamed imported logger to rslog, added new stderr method to logger that outputs to console.error |
| packages/core/src/utils/error.ts | Migrated error printing functions to use logger.stderr() for error messages, stack traces, and code frames |
| packages/core/src/reporter/utils.ts | Changed test case errors to use logger.log() instead of console.error() for consistency |
| packages/core/src/reporter/summary.ts | Updated failing test summary to output to stderr |
| packages/core/src/reporter/junit.ts | Migrated error messages to logger.stderr() while keeping informational messages on stdout |
| packages/core/src/reporter/index.ts | Added logic to route console logs to stdout or stderr based on log.type field |
| packages/core/src/reporter/githubActions.ts | Replaced console.log() with logger.log() for consistency |
| packages/core/src/cli/prepare.ts | Replaced console.log() with logger.log() for consistency |
| e2e/test-api/*.test.ts | Updated tests to use expectStderrLog() for error message assertions |
| e2e/lifecycle/*.test.ts | Updated tests to check stderr stream for error messages |
| e2e/expect/test/soft.test.ts | Changed to read from stderr stream for error assertions |
| e2e/dom/*.test.ts | Updated tests to use expectStderrLog() for error assertions |
| e2e/diff/index.test.ts | Changed to read diff output from stderr |
| e2e/snapshot/diff.test.ts | Changed to read diff output from stderr |
| e2e/log/trace.test.ts | Updated to check stderr for console.error traces and use cli.log for combined output |
| e2e/setup/index.test.ts | Updated to use expectStderrLog() for setup error assertions |
| e2e/runner/test/processKill.test.ts | Updated to use expectStderrLog() for process kill error assertions |
| e2e/projects/index.test.ts | Updated to use expectStderrLog() for error assertions |
| e2e/build/fixtures/plugin/rstest.config.ts | Simplified import statement (unrelated cleanup) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
support output error message to stderr

Related Links
Checklist