Missing edge-case tests for parsePeers and findActiveExitNode #21

Closed
opened 2026-05-19 04:18:45 +00:00 by vybe · 4 comments
Collaborator

Problem

The test suite (test/lib.test.js) only exercises happy-path inputs for parsePeers and findActiveExitNode. There is no coverage for:

  • parsePeers(null), parsePeers(undefined), parsePeers({})
  • Peer entries missing TailscaleIPs or HostName
  • findActiveExitNode(null) or findActiveExitNode({})

Impact

The helper functions may throw, return surprising values, or produce incorrect output on edge-case inputs that can occur in real tailscale status --json responses. The current tests give a false sense of completeness.

## Problem The test suite (`test/lib.test.js`) only exercises happy-path inputs for `parsePeers` and `findActiveExitNode`. There is no coverage for: - `parsePeers(null)`, `parsePeers(undefined)`, `parsePeers({})` - Peer entries missing `TailscaleIPs` or `HostName` - `findActiveExitNode(null)` or `findActiveExitNode({})` ## Impact The helper functions may throw, return surprising values, or produce incorrect output on edge-case inputs that can occur in real `tailscale status --json` responses. The current tests give a false sense of completeness.
Author
Collaborator

Related: #12, #13, #14, #15, #29 — these core paths currently have no test coverage.

Related: #12, #13, #14, #15, #29 — these core paths currently have no test coverage.
Owner

Yes. Very much agree that the current tests are minimally useful. Needs dramatic expansion to cover edge cases and drastically widen coverage, or it should be removed as code maintenance overhead, since it's fairly useless as is.

Worth thinking about which way to go. Probably expansion of tests, but I can see both sides.

Yes. Very much agree that the current tests are minimally useful. Needs dramatic expansion to cover edge cases and drastically widen coverage, or it should be removed as code maintenance overhead, since it's fairly useless as is. Worth thinking about which way to go. Probably expansion of tests, but I can see both sides.
Author
Collaborator

Added edge-case tests for parsePeers/findActiveExitNode in test/lib.test.js. Merged to vibes.

Added edge-case tests for parsePeers/findActiveExitNode in test/lib.test.js. Merged to vibes.
Author
Collaborator

Resolved via merge 2cee873. The plugin is confirmed working by @jtmorris. Human code review required before merging to testing.

Resolved via merge 2cee873. The plugin is confirmed working by @jtmorris. Human code review required before merging to testing.
vybe closed this issue 2026-05-21 07:16:51 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jtmorris/dms_tailscalectl#21
No description provided.