-
-
Notifications
You must be signed in to change notification settings - Fork 14
feat: support hideSkippedTests option
#631
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
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new hideSkippedTests configuration option that allows users to hide skipped test logs from the output when using verbose reporters. By default, all test cases including skipped ones are displayed, but setting this option to true will filter out skipped tests from the console output.
Key Changes:
- Added
hideSkippedTestsboolean configuration option with default value offalse - Updated both verbose and default reporters to conditionally hide skipped tests based on the new option
- Added comprehensive documentation in English and Chinese for the new feature
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/config.ts | Added hideSkippedTests optional boolean property to RstestConfig interface |
| packages/core/src/config.ts | Set default value of hideSkippedTests to false in default config |
| packages/core/src/cli/commands.ts | Added CLI option --hideSkippedTests for command-line usage |
| packages/core/src/cli/init.ts | Added hideSkippedTests to CommonOptions type and config resolution |
| packages/core/src/reporter/utils.ts | Modified logCase to accept options object and skip logging when hideSkippedTests is true |
| packages/core/src/reporter/verbose.ts | Updated VerboseReporter to pass hideSkippedTests option to logCase |
| packages/core/src/reporter/index.ts | Updated DefaultReporter to pass hideSkippedTests option to logCase |
| e2e/reporter/index.test.ts | Added e2e test coverage for hideSkippedTests functionality and updated existing test expectations |
| e2e/reporter/fixtures/index.test.ts | Added skipped test case to fixture for testing |
| website/docs/en/config/test/hideSkippedTests.mdx | Added English documentation for the new option |
| website/docs/zh/config/test/hideSkippedTests.mdx | Added Chinese documentation for the new option |
| website/docs/en/config/test/_meta.json | Added hideSkippedTests to English documentation navigation |
| website/docs/zh/config/test/_meta.json | Added hideSkippedTests to Chinese documentation navigation |
| website/theme/components/ConfigOverview.tsx | Added hideSkippedTests to configuration overview component |
| packages/core/tests/core/snapshots/rstest.test.ts.snap | Updated snapshots to include hideSkippedTests default value |
| packages/core/tests/snapshots/config.test.ts.snap | Updated config snapshot to include hideSkippedTests default value |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| slowTestThreshold: number, | ||
| options: { | ||
| slowTestThreshold: number; | ||
| hideSkippedTests: boolean; |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hideSkippedTests property should be optional with a default value or have proper undefined handling, since the config type defines it as optional (hideSkippedTests?: boolean). Consider adding hideSkippedTests?: boolean with proper undefined checks, or ensure the default value is always provided at the call site.
| const isSlowCase = (result.duration || 0) > slowTestThreshold; | ||
| const isSlowCase = (result.duration || 0) > options.slowTestThreshold; | ||
|
|
||
| if (options.hideSkippedTests && result.status === 'skip') { |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition will fail if hideSkippedTests is undefined due to the optional property. Add explicit boolean check: if (options.hideSkippedTests === true && result.status === 'skip')
| if (options.hideSkippedTests && result.status === 'skip') { | |
| if (options.hideSkippedTests === true && result.status === 'skip') { |
Summary
By default, Rstest displays logs for all test cases when you use the verbose reporter.
When you set
hideSkippedTeststotrue, Rstest will hide logs for all skipped test cases after the test run is complete.The output will look like this:
Related Links
Checklist