Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Oct 21, 2025

Summary

By default, Rstest displays logs for all test cases when you use the verbose reporter.

 ✓ test/index.test.ts (2) 1ms
  ✓ Index > should add two numbers correctly (0ms)
  - Index > should test source code correctly (1ms)

 Test Files 1 passed
      Tests 1 passed | 1 skipped (2)
   Duration 93ms (build 50ms, tests 43ms)

When you set hideSkippedTests to true, Rstest will hide logs for all skipped test cases after the test run is complete.

The output will look like this:

 ✓ test/index.test.ts (2) 1ms
  ✓ Index > should add two numbers correctly (0ms)

 Test Files 1 passed
      Tests 1 passed | 1 skipped (2)
   Duration 93ms (build 50ms, tests 43ms)

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 21, 2025 03:17
@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit c496a8c
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68f6fb61680a77000867fe82
😎 Deploy Preview https://deploy-preview-631--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a 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 hideSkippedTests boolean configuration option with default value of false
  • 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;
Copy link

Copilot AI Oct 21, 2025

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.

Copilot uses AI. Check for mistakes.
const isSlowCase = (result.duration || 0) > slowTestThreshold;
const isSlowCase = (result.duration || 0) > options.slowTestThreshold;

if (options.hideSkippedTests && result.status === 'skip') {
Copy link

Copilot AI Oct 21, 2025

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')

Suggested change
if (options.hideSkippedTests && result.status === 'skip') {
if (options.hideSkippedTests === true && result.status === 'skip') {

Copilot uses AI. Check for mistakes.
@9aoy 9aoy merged commit 7a2cb1c into main Oct 21, 2025
29 of 30 checks passed
@9aoy 9aoy deleted the hideSkippedTests branch October 21, 2025 05:21
@9aoy 9aoy mentioned this pull request Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants