test: add TypeScript compiler validation tests for github api route (… - #7348
Conversation
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
Hey! Thanks for adding TypeScript compiler tests for the GitHub API schemas. Using expectTypeOf explicitly on the Zod inferred types prevents schema mismatches from silently breaking production.
I'm assigning level:beginner, type:testing, and quality:clean.
Solid, approving!
|
🎉 Congratulations @adityapandey4621! Your PR has been successfully merged. 🚀 Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
Keep building! 💻✨ |
Description
Fixes #6767
I've added the required isolated tests for TypeScript compiler validation and schema constraints on the GitHub API route (
app/api/github/route.ts). This ensures our type declarations and API schemas remain strictly enforced and safe from regressions.Specifically, I:
app/api/github/route.type-compiler.test.tswith 5 target test cases.expectTypeOfto ensure our inferred output properties exactly match the expected data types.z.inputschemas to guarantee that passing invalid types is properly blocked during static type checking.GETroute handler to ensure it properly accepts aRequestand resolves to aResponse.Pillar
Visual Preview
(N/A — This is a backend testing and TypeScript infrastructure PR)
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.