Skip to content

Add support for RSC tests to packages/react #8451

Open

Description

@joshblack

We currently have testing coverage for typical client-driven interactions in the browser. However, it'd be great to use vitest-plugin-rsc and vitest-plugin-rsc/testing-library to allow for RSC testing in the package. This helps to ensure appropriate usage of 'use client' in our components and will also allow us to apply them more granularly than we currently do.

This helps to ensure that components that are imported can be rendered in an RSC-context.

Activity

  1. added theissue type on Sep 29, 2026
  2. github-actions commented on Sep 29, 2026

    @github-actions
    Contributor

    ⚠️ Assignment failed: Failed to assign copilot coding agent to this issue.

    Error: copilot coding agent is not available for this repository

  3. DiFronzo commented on Oct 23, 2026

    @DiFronzo

    I'd like to pick this up. Looking at the setup, it seems like this belongs in the node project in packages/react/vitest.config.mts alongside ssr.test.tsx, using the plugin's testing-library helper to render components inside an RSC boundary. That keeps it out of vitest.config.browser.mts and leaves the Chromium suite alone.

    One question before I start: vitest-plugin-rsc has peer dependencies on Next >= 16.4 and Vitest >= 5, so adding it pulls Next into the dev dependencies of a package that doesn't otherwise use it. Is that fine, or would you rather isolate it in a small fixture workspace that only tests the 'use client' boundary so the main test config stays Next-free?

    Let me know if someone is already working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    reactstaffAuthor is a staff member

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions