Add hybrid controller support for mocking#893
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: lokalise/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe pull request expands the universal-testing-utils mocking library to support dual-mode contracts that serve either JSON or Server-Sent Events (SSE) responses based on the client's Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/app/universal-testing-utils/README.md`:
- Around line 488-493: Update the README to clarify that MockttpHelper and
MswHelper differ: explain that mockValidResponse and mockSseResponse handlers in
MswHelper "pass through" by returning undefined (allowing other handlers), while
MockttpHelper returns HTTP 503 when the Accept header doesn't match; mention the
practical implication that mocks do not fully "coexist" under MockttpHelper
unless tests explicitly handle the 503 behavior, and suggest either documenting
the difference or instructing consumers to use the matching helper for
consistent behavior (reference MockttpHelper, MswHelper, mockValidResponse,
mockSseResponse).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: lokalise/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 71cf03e8-51fe-4e7c-b22b-a37a839308a0
📒 Files selected for processing (6)
packages/app/universal-testing-utils/README.mdpackages/app/universal-testing-utils/src/MockttpHelper.spec.tspackages/app/universal-testing-utils/src/MockttpHelper.tspackages/app/universal-testing-utils/src/MswHelper.spec.tspackages/app/universal-testing-utils/src/MswHelper.tspackages/app/universal-testing-utils/test/testContracts.ts
Changes
Fix REST+SSE
Checklist
major,minor,patchorskip-releaseAI Assistance Tracking
We're running a metric to understand where AI assists our engineering work. Please select exactly one of the options below:
Mark "Yes" if AI helped in any part of this work, for example: generating code, refactoring, debugging support,
explaining something, reviewing an idea, or suggesting an approach.