Skip to content

Add concurrency tests#13

Merged
AbanoubGhadban merged 17 commits intomainfrom
abanoub-ghadban/add-concurrency-tests
Dec 16, 2025
Merged

Add concurrency tests#13
AbanoubGhadban merged 17 commits intomainfrom
abanoub-ghadban/add-concurrency-tests

Conversation

@AbanoubGhadban
Copy link
Collaborator

@AbanoubGhadban AbanoubGhadban commented Dec 16, 2025

Summary by CodeRabbit

Release Notes

  • Tests

    • Added automated unit testing on all pull requests via GitHub Actions
    • Configured testing framework with TypeScript support
    • Implemented comprehensive test suite for concurrent rendering scenarios
  • Chores

    • Added testing dependencies and npm scripts
    • Updated TypeScript configuration for JSX support

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR establishes comprehensive testing infrastructure for concurrent React Server Component rendering. It adds Jest configuration, GitHub Actions CI workflow, test utilities for async queue-based stream processing, and RSC/HTML concurrent rendering test suites. Package.json is updated with test scripts and dev dependencies.

Changes

Cohort / File(s) Summary
CI & Test Configuration
.github/workflows/unit-tests.yml, jest.config.js, tsconfig.json
Added GitHub Actions workflow to run tests on PRs; configured Jest with ts-jest for TypeScript support, Node environment, and RSC-specific test paths; enabled JSX runtime in TypeScript compiler.
Package Configuration
package.json
Added three test scripts (test, test:rsc, test:non-rsc) to run Jest with NODE_CONDITIONS and pattern filtering; added dev dependencies for Jest, ts-jest, React, React types, and Jest types.
Test Utilities
tests/AsyncQueue.ts, tests/AsyncQueueContainer.tsx, tests/StreamReader.ts, tests/generateRSCPayloadChunks.tsx
Implemented AsyncQueue class with EventEmitter-based enqueue/dequeue/end operations; created AsyncQueueContainer React component with nested Suspense-wrapped AsyncQueueItem; built StreamReader to wrap Node streams with TextDecoder and async queue integration; added generateRSCPayloadChunks utility to collect and persist RSC payload chunks to JSON.
RSC & Concurrent Rendering Tests
tests/concurrentRendering.rsc.test.tsx, tests/concurrentlyRenderHtml.test.tsx, tests/generateRSCPayloadChunks.rsc.test.tsx
Added RSC test suite validating concurrent stream rendering, console isolation between components, and error handling; added HTML concurrent rendering tests with parallel stream processing and chunk validation; added test to verify RSC payload chunk file generation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • AsyncQueue.ts & StreamReader.ts: Review EventEmitter coordination, buffer management, debounce logic, and Promise/error handling in async dequeue operations
  • concurrentlyRenderHtml.test.tsx: Verify complex multi-step streaming assertions, chunk payload validation, and parallel stream synchronization logic
  • Test script configuration: Ensure NODE_CONDITIONS and test path patterns correctly isolate RSC vs. non-RSC tests

Possibly related PRs

  • Add concurrency tests #10: Directly related—modifies identical CI workflow, Jest config, package.json scripts, and adds the same test utilities and RSC concurrent rendering test suite.

Poem

🐰 A queue of tests now hops with glee,
Async streams flow wild and free,
Jest and RSC dance in sync,
Concurrent renders blink and wink,
CI workflows guard each pull with care,
Testing magic fills the air!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch abanoub-ghadban/add-concurrency-tests

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d10a0e and 0d85547.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • .github/workflows/unit-tests.yml (1 hunks)
  • jest.config.js (1 hunks)
  • package.json (2 hunks)
  • tests/AsyncQueue.ts (1 hunks)
  • tests/AsyncQueueContainer.tsx (1 hunks)
  • tests/StreamReader.ts (1 hunks)
  • tests/concurrentRendering.rsc.test.tsx (1 hunks)
  • tests/concurrentlyRenderHtml.test.tsx (1 hunks)
  • tests/generateRSCPayloadChunks.rsc.test.tsx (1 hunks)
  • tests/generateRSCPayloadChunks.tsx (1 hunks)
  • tsconfig.json (1 hunks)

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 and usage tips.

@AbanoubGhadban AbanoubGhadban merged commit 1e5469d into main Dec 16, 2025
2 of 3 checks passed
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.

1 participant