Skip to content

test: add unit tests for isYggdrasilAddr validation #13

Description

@Jing-yilin

Description

The isYggdrasilAddr() function validates that an IPv6 address is in the Yggdrasil 200::/7 range. It's used in the security layer but currently has limited test coverage.

What to Do

Add test cases in a new or existing test file:

  • Valid Yggdrasil addresses (200::, 300::, 3ff::)
  • Invalid addresses (::1, fe80::, 2001:db8::, empty string, garbage)
  • Edge cases (200:: vs 200::1, 1ff:: just below range)

Where to Look

  • src/peer-server.ts or src/identity.ts — where isYggdrasilAddr is defined
  • test/ — existing test files for patterns

Difficulty

Easy — write test cases for a pure function.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerstestTest additions/changes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions