test: cover zod schema query validation types#1404
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds an import of ChangesType test coverage for getValidatedQuery with Zod
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@test/unit/types.test-d.ts`:
- Around line 10-11: The test currently imports defineEventHandler from the
barrel file "../../src/index.ts"; change that to import defineEventHandler
directly from its specific module file (find the import block in
test/unit/types.test-d.ts that lists defineEventHandler) and update the import
path to the module that actually exports defineEventHandler (e.g., the file
where the function is defined) so the test no longer relies on the barrel
export; apply the same direct-module import approach to any other symbols in
that import block if modified.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 92bde70d-2c58-4c9d-b9f6-2a4718d9c991
📒 Files selected for processing (1)
test/unit/types.test-d.ts
Summary
getValidatedQuery(event, z.object(...))defineHandlerand thedefineEventHandler({ handler })shape from the issue reproductionanyand matches the Zod schema outputCloses #1403
Notes
Current
mainaccepts this usage, so this PR adds regression coverage to keep the Zod schema overload working.Validation
corepack pnpm vitest run test/unit/types.test-d.tscorepack pnpm exec oxlint test/unit/types.test-d.tscorepack pnpm exec oxfmt --check test/unit/types.test-d.tsgit diff --checkSummary by CodeRabbit