Skip to content

chore: getting test coverage back to normal levels#124

Merged
jaredwray merged 4 commits intomainfrom
chore-getting-test-coverage-back-to-normal-levels
Feb 13, 2026
Merged

chore: getting test coverage back to normal levels#124
jaredwray merged 4 commits intomainfrom
chore-getting-test-coverage-back-to-normal-levels

Conversation

@jaredwray
Copy link
Owner

@jaredwray jaredwray commented Feb 13, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
chore: getting test coverage back to normal levels

@gemini-code-assist
Copy link

Summary of Changes

Hello @jaredwray, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the test coverage and robustness of the certificate generation module. By exposing and thoroughly testing key internal utility functions related to integer encoding and IPv6 address expansion, the changes ensure that these critical components behave as expected under various conditions, contributing to a more reliable certificate generation process.

Highlights

  • Testability Improvement: Exported the internal utility functions encodeInteger and expandIpv6 from src/certificate.ts as _encodeInteger and _expandIpv6 respectively, specifically for testing purposes.
  • Enhanced Test Coverage for _encodeInteger: Added new unit tests for the _encodeInteger function, covering scenarios such as encoding zero, and handling numbers and buffers where the high bit is set, ensuring correct DER INTEGER encoding.
  • Enhanced Test Coverage for _expandIpv6: Implemented new unit tests for the _expandIpv6 function to verify its ability to correctly pad groups in fully-expanded IPv6 addresses and expand the :: shorthand notation for both left and right empty sides.
  • IPv6 AltName Handling Test: Included a new test case for generateCertificate to confirm its proper handling of fully-expanded IPv6 altNames without the :: shorthand.
Changelog
  • src/certificate.ts
    • Exported internal functions encodeInteger and expandIpv6 for testing.
  • test/certificate.test.ts
    • Imported newly exported internal functions _encodeInteger and _expandIpv6.
    • Added new test suite for _encodeInteger covering various encoding scenarios.
    • Added new test suite for _expandIpv6 to validate IPv6 address expansion.
    • Added a new test case for generateCertificate to verify IPv6 altName handling.
Activity
  • No activity has been recorded yet for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c1cafcd) to head (d3583e9).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #124      +/-   ##
===========================================
+ Coverage   99.52%   100.00%   +0.47%     
===========================================
  Files          37        37              
  Lines        1042      1044       +2     
  Branches      208       208              
===========================================
+ Hits         1037      1044       +7     
+ Misses          5         0       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully increases test coverage by exporting and testing two internal functions, encodeInteger and expandIpv6. The new tests are well-written and cover important cases. I've added a couple of suggestions to make the test suite for expandIpv6 more comprehensive and to address a potentially brittle assertion in one of the new tests that relies on a specific output format from Node.js's crypto module.

@jaredwray jaredwray merged commit 05dc3e3 into main Feb 13, 2026
7 checks passed
@jaredwray jaredwray deleted the chore-getting-test-coverage-back-to-normal-levels branch February 13, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant