Skip to content

Add official guide or helper for integration/system testing with RSC and the Node renderer #3181

@justin808

Description

@justin808

Context

While building the Hacker News demo at https://github.com/shakacode/react_on_rails-hacker-news-app, getting integration/system tests stable with RSC + the Node renderer took more manual setup than expected.

We ended up needing a fairly specific test harness:

  • set renderer-related env vars before Rails boot
  • compile test assets ahead of time
  • start a dedicated renderer process for the test environment
  • isolate or clear renderer bundle caches
  • avoid unsafe parallelization in certain paths
  • use a fake Hacker News API to keep tests deterministic

Problem

There is not yet a clear first-class recipe for testing this stack in a normal Rails app, especially for Capybara/system tests and end-to-end integration tests.

That leads to failures that look like timeouts, missing assets, or renderer instability instead of obviously being a setup problem.

Requested improvement

Please add official guidance or a helper for integration/system testing with RSC and the Node renderer.

Useful coverage would include:

  • when to compile assets for test
  • how to boot/shutdown the renderer in test
  • bundle-cache isolation guidance
  • caveats for parallel test execution
  • a concrete Capybara/system test example
  • guidance on stubbing external APIs while still exercising the RSC path

Related

Issue #3076 touched CI setup and some RSC integration pitfalls. This issue is narrower and asks for a first-class testing recipe/helper for app authors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions