Skip to content

Conversation

@9aoy
Copy link
Collaborator

@9aoy 9aoy commented Jan 5, 2026

Summary

Support extend Rstest configuration from Rsbuild config file via @rstest/adapter-rsbuild.

import { defineConfig } from '@rstest/core';
import { withRsbuildConfig } from '@rstest/adapter-rsbuild`';

export default defineConfig({
  // Automatically read rsbuild.config.ts and convert to Rstest configuration
  extends: withRsbuildConfig(),
  // Other test configurations
  coverage: {
    // ...
  },
});

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings January 5, 2026 11:34
@netlify
Copy link

netlify bot commented Jan 5, 2026

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 140339d
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/695cadb3b7324a00080a0787
😎 Deploy Preview https://deploy-preview-830--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 adds @rstest/adapter-rsbuild, a new official adapter that allows Rstest to automatically inherit configuration from Rsbuild config files. This enables seamless integration between Rstest and Rsbuild projects, eliminating configuration duplication.

Key Changes

  • Introduces @rstest/adapter-rsbuild package with withRsbuildConfig() function for extending Rstest config from Rsbuild
  • Adds comprehensive documentation in both English and Chinese explaining installation, usage, and configuration mapping
  • Updates the React example to demonstrate the adapter usage, migrating from jsdom to happy-dom

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/adapter-rsbuild/src/index.ts Core implementation of the adapter with config loading and conversion logic
packages/adapter-rsbuild/tests/index.test.ts Test suite covering config loading, environment merging, and error handling
packages/adapter-rsbuild/package.json Package configuration with dependencies and metadata
packages/adapter-rsbuild/README.md Comprehensive adapter documentation with usage examples
packages/adapter-rsbuild/rslib.config.mts Build configuration for the adapter package
packages/adapter-rsbuild/rstest.config.ts Test configuration for the adapter package
packages/adapter-rsbuild/tsconfig.json TypeScript configuration for the adapter
website/docs/en/guide/integration/rsbuild.mdx English integration guide
website/docs/zh/guide/integration/rsbuild.mdx Chinese integration guide
website/docs/en/guide/integration/adapters.mdx Added Rsbuild adapter reference
website/docs/zh/guide/integration/adapters.mdx Added Rsbuild adapter reference (Chinese)
website/docs/en/guide/integration/_meta.json Updated navigation metadata
website/docs/zh/guide/integration/_meta.json Updated navigation metadata (Chinese)
examples/react/rstest.config.ts Refactored to use the new adapter
examples/react/package.json Updated dependencies to use adapter and happy-dom
pnpm-lock.yaml Dependency updates for new adapter package
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

9aoy and others added 3 commits January 6, 2026 11:11
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
@9aoy 9aoy requested a review from chenjiahan January 6, 2026 07:31
@9aoy 9aoy merged commit cbe83ce into main Jan 8, 2026
24 of 25 checks passed
@9aoy 9aoy deleted the adpater-rsbuild branch January 8, 2026 03:49
@chenjiahan chenjiahan changed the title feat: adapter-rsbuild feat: add new adapter for Rsbuild Jan 8, 2026
@9aoy 9aoy mentioned this pull request Jan 9, 2026
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