Add type compiler validation tests for GitHubUserValidator - #3098
Conversation
|
@atul-upadhyay-7 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
👋 Hey @atul-upadhyay-7, it looks like you didn't use our PR template! The section Please update your PR description to include all required sections so we can review this properly:
You can find the full template in CONTRIBUTING.md. Just edit your PR description and the |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds type-level compiler tests for the GitHubUserValidator class to verify its public API signatures using vitest's expectTypeOf.
Changes:
- Adds type assertions for
validateUserparameters and return type. - Adds type assertions for the
getInstancesingleton andresetmethod. - Adds negative type assertions ensuring non-string types are not accepted.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d0749ea to
ffd5698
Compare
|
@JhaSourav07 Hi! I've updated PR #3098 to address the issues. What I fixed:
Current CI status:
Summary of changes:
Could you please:
Thanks! |
|
@JhaSourav07 could you review this |
|
🎉 Congratulations @atul-upadhyay-7! 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! 💻✨ |
…07#3098) ## Description Closes JhaSourav07#2962 Adds type-level compiler tests for the `GitHubUserValidator` class in `services/github/validate-user.ts`. The test file uses Vitest's `expectTypeOf` to verify the public API signatures of `validateUser`, `getInstance`, and `reset` methods, including negative type assertions that ensure non-string types are not accepted by `validateUser`. ## Pillar - [x] 🛠️ Other (Test coverage for type compiler validation) ## What changed - Added `services/github/validate-user.type-compiler.test.ts` with 5 test cases: - Parameter and return type assertions for `validateUser` - Singleton instance pattern type verification for `getInstance` - Return type verification for `reset` method (`void`) - Negative type assertions ensuring only strings are accepted - Schema validation constraints return type verification ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally (`npx vitest run services/github/validate-user.type-compiler.test.ts`). - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [x] I have made sure that I have only one commit to merge in this PR.
Description
Closes #2962
Adds type-level compiler tests for the
GitHubUserValidatorclass inservices/github/validate-user.ts. The test file uses Vitest'sexpectTypeOfto verify the public API signatures ofvalidateUser,getInstance, andresetmethods, including negative type assertions that ensure non-string types are not accepted byvalidateUser.Pillar
What changed
services/github/validate-user.type-compiler.test.tswith 5 test cases:validateUsergetInstanceresetmethod (void)Checklist before requesting a review:
CONTRIBUTING.mdfile.npx vitest run services/github/validate-user.type-compiler.test.ts).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).