Skip to content

feat: add JUnit reporter#528

Merged
9aoy merged 8 commits intomainfrom
junit-reporter
Sep 1, 2025
Merged

feat: add JUnit reporter#528
9aoy merged 8 commits intomainfrom
junit-reporter

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Sep 1, 2025

Summary

The JUnit reporter supports outputting test reports in JUnit XML format, making it easy to integrate with CI/CD.

import { defineConfig } from '@rstest/core';

export default defineConfig({
  reporters: [['junit', { outputPath: './junit.xml' }]],
});

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings September 1, 2025 09:26
@netlify
Copy link
Copy Markdown

netlify bot commented Sep 1, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 56d0627
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68b56a2a441d0900088bfae5
😎 Deploy Preview https://deploy-preview-528--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
Copy Markdown
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 adds a JUnit XML reporter to the RSTest testing framework, enabling test results to be output in JUnit XML format for CI/CD integration.

  • Added a new JUnitReporter class that generates JUnit XML format reports
  • Updated documentation in both English and Chinese to describe the new JUnit reporter
  • Added comprehensive test coverage for the JUnit reporter functionality

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/core/src/reporter/junit.ts Main implementation of the JUnit reporter with XML generation logic
packages/core/src/core/rstest.ts Registration of the new JUnit reporter in the reporter registry
packages/core/src/utils/error.ts Refactored error handling to export formatStack function for reuse
packages/core/tests/reporter/junit.test.ts Unit tests for the JUnit reporter functionality
e2e/reporter/junit.test.ts End-to-end test for JUnit reporter CLI integration
e2e/reporter/fixtures/junit.test.ts Test fixture file for e2e testing
packages/core/package.json Added strip-ansi dependency
packages/core/LICENSE.md Added license information for strip-ansi
website/docs/en/config/test/reporters.mdx English documentation for JUnit reporter
website/docs/zh/config/test/reporters.mdx Chinese documentation for JUnit reporter
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

import { defineConfig } from '@rstest/core';

export default defineConfig({
reporters: [['junit', { outputPath: './junit.xml' }]]
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration example is missing a trailing comma after the array element. This should be reporters: [['junit', { outputPath: './junit.xml' }]], to match proper JavaScript/TypeScript syntax and be consistent with other examples in the file.

Suggested change
reporters: [['junit', { outputPath: './junit.xml' }]]
reporters: [['junit', { outputPath: './junit.xml' }]],

Copilot uses AI. Check for mistakes.
9aoy and others added 5 commits September 1, 2025 17:30
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@9aoy 9aoy merged commit c65f4ca into main Sep 1, 2025
16 checks passed
@9aoy 9aoy deleted the junit-reporter branch September 1, 2025 11:34
@watsonhaw5566
Copy link
Copy Markdown

前端为什么也可以输入出 Junit 的?这很有趣啊。

@9aoy 9aoy mentioned this pull request Sep 3, 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.

3 participants