Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Sep 28, 2025

Summary

Support reportOnFailure option. By default, rstest will not report coverage and check thresholds when test fails.

import { defineConfig } from '@rstest/core';
export default defineConfig({
  coverage: {
    enabled: true,
    reportOnFailure: true,
  },
});

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings September 28, 2025 03:46
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

Adds a new reportOnFailure configuration option to control whether coverage reports are generated when tests fail. By default, rstest will skip coverage reporting when tests fail, but this option allows users to override that behavior.

  • Added reportOnFailure boolean option to CoverageOptions type with default value of false
  • Modified test runner logic to conditionally generate coverage reports based on test results and the new option
  • Updated documentation in both English and Chinese to explain the new configuration option

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/types/coverage.ts Added reportOnFailure property to CoverageOptions type
packages/core/src/core/runTests.ts Updated coverage generation logic to respect the new option
packages/core/src/config.ts Added default value for reportOnFailure in configuration
website/docs/en/config/test/coverage.mdx Added English documentation for the new option
website/docs/zh/config/test/coverage.mdx Added Chinese documentation for the new option

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@netlify
Copy link

netlify bot commented Sep 28, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 2437338
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68d8b047a1ea8a000832225b
😎 Deploy Preview https://deploy-preview-597--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.

@9aoy 9aoy merged commit 96a9f1f into main Sep 28, 2025
16 checks passed
@9aoy 9aoy deleted the coverage-reportOnFailure branch September 28, 2025 05:40
@9aoy 9aoy mentioned this pull request Sep 30, 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.

1 participant