test: add trustedProxy coverage tests#5329
Conversation
|
@navyabansal21 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 @navyabansal21, the CI Pipeline is failing on this PR and it has been marked as Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run format:check # Check Prettier formatting
npm run lint # Run ESLint
npm run typecheck # TypeScript type check
npm run test # Run unit tests (Vitest)
npm run build # Verify production build passes2. Auto-fix common issues: npm run format # Auto-fix formatting with Prettier
npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I've reviewed the tests, and while they correctly validate the trusted proxy logic, the file naming and test suite description seem to be incorrect. They currently refer to 'Theme Contrast Cohesion', which doesn't align with the content of the tests.
Please rename the file from \ rustedProxy.theme-contrast.test.ts\ to something more appropriate like \ rustedProxy.coverage.test.ts, or simply merge these tests into the existing \ rustedProxy.test.ts. Similarly, please update the \describe\ block to reflect what is actually being tested (e.g., 'Trusted Proxy Utilities').
Labels Applied:
- \level:beginner: This PR adds self-contained unit tests for existing utility functions without complex setup.
- \ ype:testing: The primary purpose of this PR is to add unit tests.
- \mentor:Aamod007\
Once these minor naming issues are resolved, this will be ready to merge.
|
Review Update |
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for renaming the file and updating the test description! Approving.
|
🎉 Congratulations @navyabansal21! 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
Adds a new test suite for
utils/trustedProxy.tsinutils/trustedProxy.theme-contrast.test.ts.The target file contains trusted proxy and IP validation utilities, so the tests focus on the actual implemented behavior, including IPv4 validation, CIDR matching, trusted proxy detection, and private range handling.
Fixes #4542
Pillar
Visual Preview
N/A (test-only changes)
Checklist before requesting a review:
CONTRIBUTING.mdfile.npm run formatandnpm run lintlocally and resolved all errors.README.mdif I added a new theme or URL parameter. (Not applicable)