Skip to content

feat(test): support inline Rstest projects#48

Merged
chenjiahan merged 3 commits into
mainfrom
9aoy/feat-rstest-inline-projects
Jul 20, 2026
Merged

feat(test): support inline Rstest projects#48
chenjiahan merged 3 commits into
mainfrom
9aoy/feat-rstest-inline-projects

Conversation

@9aoy

@9aoy 9aoy commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This PR allows define.test() to use Rstest inline projects while preserving automatic inheritance from define.app() or define.lib().

The shared adapter is resolved once and applied to each inline project unless the project provides its own extends, while string project entries remain unchanged.

import { define } from 'rstack';
import { defineInlineProject } from 'rstack/test';

define.app({
  // Shared Rsbuild configuration
});

define.test({
  projects: [
    defineInlineProject({
      name: 'ssr',
      include: ['./tests/ssr.test.tsx'],
      testEnvironment: 'node',
    }),
    defineInlineProject({
      name: 'dom',
      include: ['./tests/dom.test.tsx'],
      testEnvironment: 'happy-dom',
    }),
  ],
});

It also adds app and library regression coverage, testing documentation, and a React SSR example demonstrating Node.js and happy-dom projects.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@9aoy, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f8f75889-c486-41c9-b26e-ebc5c59c01b0

📥 Commits

Reviewing files that changed from the base of the PR and between 96c5393 and 3329859.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • README.md
  • examples/documentation/docs/api/testing.mdx
  • examples/rstest-inline-projects/package.json
  • examples/rstest-inline-projects/rstack.config.ts
  • examples/rstest-inline-projects/src/App.tsx
  • examples/rstest-inline-projects/src/index.tsx
  • examples/rstest-inline-projects/tests/dom.test.tsx
  • examples/rstest-inline-projects/tests/ssr.test.tsx
  • examples/rstest-inline-projects/tsconfig.json
📝 Walkthrough

Walkthrough

The change refactors automatic extends handling for Rstest configurations, including inline project inheritance and explicit overrides. New tests cover app and library configuration propagation across multiple projects. Documentation explains test project setup and selection. A React SSR example adds app configuration, browser and server test environments, React components, test cases, and TypeScript settings.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: support for inline Rstest projects in tests.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the new inline project behavior and related coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 9aoy/feat-rstest-inline-projects

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/app-react-ssr/src/index.tsx`:
- Around line 1-8: Replace createRoot with React’s hydrateRoot in the browser
entrypoint so the existing server-rendered markup is hydrated rather than
re-rendered. Update the import and invocation in the root-handling block while
preserving the existing App render and root null check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a1771b6-3e9b-4466-916c-4c93684ffd61

📥 Commits

Reviewing files that changed from the base of the PR and between 62207ea and 96c5393.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • README.md
  • examples/app-react-ssr/package.json
  • examples/app-react-ssr/rstack.config.ts
  • examples/app-react-ssr/src/App.tsx
  • examples/app-react-ssr/src/index.tsx
  • examples/app-react-ssr/tests/dom.test.tsx
  • examples/app-react-ssr/tests/ssr.test.tsx
  • examples/app-react-ssr/tsconfig.json
  • examples/documentation/docs/api/_meta.json
  • examples/documentation/docs/api/testing.mdx
  • packages/rstack/src/config.ts
  • packages/rstack/src/rstestConfig.ts
  • packages/rstack/test/config/define-test-projects-app/custom.ts
  • packages/rstack/test/config/define-test-projects-app/first.ts
  • packages/rstack/test/config/define-test-projects-app/index.test.ts
  • packages/rstack/test/config/define-test-projects-app/rstack.config.ts
  • packages/rstack/test/config/define-test-projects-app/second.ts
  • packages/rstack/test/config/define-test-projects-lib/first.ts
  • packages/rstack/test/config/define-test-projects-lib/index.test.ts
  • packages/rstack/test/config/define-test-projects-lib/rstack.config.ts
  • packages/rstack/test/config/define-test-projects-lib/second.ts

Comment thread examples/app-react-ssr/src/index.tsx Outdated
Comment thread examples/rstest-inline-projects/src/App.tsx
@@ -0,0 +1,105 @@
# Testing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I will move ths page to Rstack CLI website in the future

@chenjiahan
chenjiahan merged commit 753b566 into main Jul 20, 2026
3 checks passed
@chenjiahan
chenjiahan deleted the 9aoy/feat-rstest-inline-projects branch July 20, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants