Skip to content

Use correct interface#912

Merged
kibertoad merged 2 commits intomainfrom
fix/mock-interface
Apr 10, 2026
Merged

Use correct interface#912
kibertoad merged 2 commits intomainfrom
fix/mock-interface

Conversation

@kibertoad
Copy link
Copy Markdown
Collaborator

@kibertoad kibertoad commented Apr 10, 2026

Changes

We should not rely on implementation here, high level interface is more flexible

Additionally, fixed universal-testing-utils tests broken by MSW 2.13.x:

  • MSW 2.13.x added an invariant that prevents calling server.listen() on an already-enabled server
  • The test was calling server.listen() in beforeEach, which fails on the second test since the server is already listening
  • Changed to beforeAll to match the standard MSW lifecycle pattern (beforeAll/afterAll for listen/close, afterEach for resetHandlers)
  • Updated README example to reflect the corrected pattern

Checklist

  • Apply one of following labels; major, minor, patch or skip-release
  • I've updated the documentation, or no changes were necessary
  • I've updated the tests, or no changes were necessary

AI 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.

  • Yes, AI assisted with this PR
  • No, AI did not assist with this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

The pull request updates type annotations in the MSW testing utility module, replacing SetupServerApi with SetupServer across multiple method signatures and an exported type. The changes affect the MockEndpointParams type definition and five public methods of the MswHelper class: mockValidResponse, mockValidResponseWithAnyPath, mockValidResponseWithImplementation, mockAnyResponse, and mockSseStream. No functional logic or runtime behavior is altered.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Use correct interface' directly aligns with the main change: replacing SetupServerApi with SetupServer for a more flexible, high-level interface.
Description check ✅ Passed The pull request description comprehensively covers changes, includes detailed technical explanations, and addresses all required checklist items with checkmarks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mock-interface

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

@kibertoad kibertoad merged commit 60ce05c into main Apr 10, 2026
7 checks passed
@kibertoad kibertoad deleted the fix/mock-interface branch April 10, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants