Skip to content

test(checks): cover three untested edge cases in runChecks#14

Merged
protosphinx merged 1 commit intomainfrom
bot/checks-edge-case-tests
May 3, 2026
Merged

test(checks): cover three untested edge cases in runChecks#14
protosphinx merged 1 commit intomainfrom
bot/checks-edge-case-tests

Conversation

@protosphinx
Copy link
Copy Markdown
Member

Why

src/checks.ts has three code paths that had no test coverage. The config.mcpServers.size > 0 guard (documented in the README as "if neither settings.json exists, MCP server warnings are skipped") was exercised only indirectly. The description-collision negative path (Jaccard below 0.6) and the directory-name branch of name-drift were also absent from the suite.

What

  • Add test: skips mcp-server-unknown when mcpServers set is empty - verifies the size > 0 guard prevents a false positive on fresh checkouts with no settings.json
  • Add test: does not fire description-collision when Jaccard is below threshold - negative path for the Jaccard collision detector
  • Add test: does not flag name-drift when name matches the directory - the dirBase branch of the name-drift OR condition

Tests

  • File changed: test/checks.test.ts (+37 lines, 0 new dependencies)
  • Suite went from 70 to 73 passing tests
  • All 9 test files pass: vitest run clean

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (added + removed)
  • no public-API surface change
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended

Generated by Claude Code

Add tests for:
- empty mcpServers set: mcp-server-unknown is skipped when no
  settings.json is present (the config.mcpServers.size > 0 guard)
- description-collision negative path: Jaccard below 0.6 does not
  fire the collision diagnostic
- name-drift directory match: name matching dirBase passes the check
  even when the filename differs
@protosphinx protosphinx added the automated Opened by the daily bot label May 3, 2026 — with Claude
@protosphinx protosphinx merged commit 50ba2d1 into main May 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant