Skip to content

Add type compiler validation tests for GitHubUserValidator - #3098

Merged
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
atul-upadhyay-7:fix/validate-user-type-compiler-tests-final
Jun 2, 2026
Merged

Add type compiler validation tests for GitHubUserValidator#3098
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
atul-upadhyay-7:fix/validate-user-type-compiler-tests-final

Conversation

@atul-upadhyay-7

@atul-upadhyay-7 atul-upadhyay-7 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #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

  • 🛠️ 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:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (npx vitest run services/github/validate-user.type-compiler.test.ts).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have made sure that I have only one commit to merge in this PR.

Copilot AI review requested due to automatic review settings June 2, 2026 08:55
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

👋 Hey @atul-upadhyay-7, it looks like you didn't use our PR template!

The section ## Description is missing from your PR description.

Please update your PR description to include all required sections so we can review this properly:

  • ## Description — What does this PR do? Which issue does it fix?
  • ## Pillar — Which contribution pillar does this fall under?
  • ## Checklist — Have you ticked off the quality checklist?

You can find the full template in CONTRIBUTING.md. Just edit your PR description and the needs-details label will be removed automatically. 🙌

@github-actions github-actions Bot added the needs-details This PR is missing required description details. label Jun 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 validateUser parameters and return type.
  • Adds type assertions for the getInstance singleton and reset method.
  • 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.

Comment thread services/github/validate-user.type-compiler.test.ts
Comment thread services/github/validate-user.type-compiler.test.ts
Comment thread services/github/validate-user.type-compiler.test.ts
@github-actions github-actions Bot added the type:bug Something isn't working as expected label Jun 2, 2026
@atul-upadhyay-7
atul-upadhyay-7 force-pushed the fix/validate-user-type-compiler-tests-final branch from d0749ea to ffd5698 Compare June 2, 2026 12:43
@github-actions github-actions Bot removed the needs-details This PR is missing required description details. label Jun 2, 2026
@atul-upadhyay-7

Copy link
Copy Markdown
Contributor Author

@JhaSourav07 Hi! I've updated PR #3098 to address the issues.

What I fixed:

  1. PR description - Completely rewrote the description to match the required template with all sections (## Description, ## Pillar, ## Checklist). The needs-details label has been automatically removed by the bot.

  2. Branch rebased - Rebased onto the latest upstream main (now at 2e604a1) to resolve the check-conflicts failure. The branch is now up to date.

  3. type:bug label - This label appears to have been incorrectly applied. This PR adds type-level compiler tests for GitHubUserValidator (issue test(validate-user-type-compiler): verify TypeScript Compiler Validation & Schema Constraints Stability (Variation 10) #2962) — it's a test addition, not a bug fix. Could you please review and remove this label if appropriate? This is an automated label and not something I can remove myself.

Current CI status:

  • Format · Lint · Typecheck · Test — passing
  • Production Build — passing
  • check-conflicts — should now pass after rebase
  • Verify PR is Linked to an Assigned Issue — needs investigation
  • Vercel — requires your authorization to deploy (not contributor-fixable)

Summary of changes:

  • Added services/github/validate-user.type-compiler.test.ts with 5 test cases using expectTypeOf to verify the public API signatures of validateUser, getInstance, and reset methods
  • Followed the type-compiler test pattern from the repository

Could you please:

  1. Remove the type:bug label (it's incorrect)
  2. Authorize the Vercel deployment

Thanks!

@atul-upadhyay-7

Copy link
Copy Markdown
Contributor Author

@JhaSourav07 could you review this

@Aamod007 Aamod007 added GSSoC 2026 mentor:Aamod007 type:testing Adding, updating, or fixing tests level:advanced Complex contributions involving architecture, optimization, or significant feature work quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. labels Jun 2, 2026
@JhaSourav07 JhaSourav07 added level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:exceptional Outstanding contribution with exceptional implementation quality, testing. gssoc:approved PR has been reviewed and accepted for valid contribution points and removed level:advanced Complex contributions involving architecture, optimization, or significant feature work quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. labels Jun 2, 2026
@JhaSourav07
JhaSourav07 merged commit 841af16 into JhaSourav07:main Jun 2, 2026
11 of 12 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@JhaSourav07 JhaSourav07 added gssoc:approved PR has been reviewed and accepted for valid contribution points and removed gssoc:approved PR has been reviewed and accepted for valid contribution points labels Jun 17, 2026
MasterJi27 pushed a commit to MasterJi27/commitpulse that referenced this pull request Jul 4, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:bug Something isn't working as expected type:testing Adding, updating, or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(validate-user-type-compiler): verify TypeScript Compiler Validation & Schema Constraints Stability (Variation 10)

4 participants