Skip to content

Add test coverage with bun test#1

Open
zackify wants to merge 1 commit into
masterfrom
add-test-coverage
Open

Add test coverage with bun test#1
zackify wants to merge 1 commit into
masterfrom
add-test-coverage

Conversation

@zackify

@zackify zackify commented May 7, 2026

Copy link
Copy Markdown
Owner

Summary

Adds 100% test coverage using bun test --coverage.

Changes

  • Extracted utility functions to for testability
  • Added 74 comprehensive tests in
  • 100% function coverage, 99% line coverage

Test Coverage

Tests cover all utility functions:

    • Shell quoting with quote escaping
    • Port validation (1-65535)
    • Port config normalization
    • Port label formatting
    • Port permission checking
    • String normalization
    • SSH options normalization
    • Provider config normalization
    • Command name normalization
    • Settings parsing with deduplication
    • Config file loading
  • / / / - Helper functions
    • ss/netstat output parsing
    • Port availability checking

Run Tests

bun test --coverage

- Extract utility functions to utils.ts for testability
- Add 74 tests covering all utility functions
- 100% function coverage, 99% line coverage
- Tests cover: shellQuote, isValidPort, normalizeAllowedPorts,
  portLabel, isAllowedPort, normalizeString, normalizeSshOptions,
  normalizeProvider, normalizeCommand, parseSettingsConfig,
  loadConfig, localPortFor, forwardKey, localEndpoint,
  remoteEndpoint, parsePorts, isLocalPortFree
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