Redirect Next adapter to portable core runtime#59
Conversation
✅ Deploy Preview for holo-docs canceled.
|
📝 WalkthroughWalkthroughAdapter-next's runtime import switched from ChangesRuntime Import and Alias Updates
Storage Test Fixes
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/storage/tests/s3Driver.test.ts (1)
289-302: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider extracting the shared fetch mock into a helper.
The PUT/GET round-trip mock implementation is duplicated verbatim between the two test cases (lines 290–302 and 335–345). Extracting a helper would keep them in sync if the mock behavior needs to evolve.
♻️ Optional helper extraction
function createStatefulFetchMock() { const objects = new Map<string, string>() const mock = async (input: string | URL | Request) => { const request = input instanceof Request ? input : new Request(input) if (request.method === 'PUT') { objects.set(request.url, await request.text()) return new Response(null, { status: 200 }) } return new Response(objects.get(request.url) ?? '', { status: 200 }) } return { mock, objects } }Then in each test:
const { mock, objects } = createStatefulFetchMock() fetchMock.mockImplementation(mock)Also applies to: 335-345
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/storage/tests/s3Driver.test.ts` around lines 289 - 302, The PUT/GET stateful fetch mock is duplicated in the two S3 driver tests, so extract it into a shared helper to keep behavior consistent. Create a reusable helper (for example, alongside the tests) that encapsulates the Request handling and in-memory object map, then update both test cases in s3Driver.test.ts to use that helper instead of inlining the same mock logic. Keep the helper aligned with the existing round-trip behavior used in the relevant test blocks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/storage/tests/s3Driver.test.ts`:
- Around line 289-302: The PUT/GET stateful fetch mock is duplicated in the two
S3 driver tests, so extract it into a shared helper to keep behavior consistent.
Create a reusable helper (for example, alongside the tests) that encapsulates
the Request handling and in-memory object map, then update both test cases in
s3Driver.test.ts to use that helper instead of inlining the same mock logic.
Keep the helper aligned with the existing round-trip behavior used in the
relevant test blocks.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5ec04c52-92b8-474e-bca6-3471e409f450
📒 Files selected for processing (5)
packages/adapter-next/src/runtime.tspackages/adapter-next/tsconfig.jsonpackages/adapter-next/vitest.config.tspackages/core/tests/adapter.test.tspackages/storage/tests/s3Driver.test.ts
Summary by CodeRabbit
Bug Fixes
Tests