Skip to content

test(match): add direct unit tests for requestKey, responseKey, methodOf#14

Merged
protosphinx merged 1 commit into
mainfrom
bot/test-match-keys
May 13, 2026
Merged

test(match): add direct unit tests for requestKey, responseKey, methodOf#14
protosphinx merged 1 commit into
mainfrom
bot/test-match-keys

Conversation

@protosphinx
Copy link
Copy Markdown
Member

Why

requestKey and responseKey are exported from src/match.ts and
re-exported via src/index.ts. They form the backbone of the
diffTranscripts logic: every pair comparison goes through them. Yet
they had no dedicated unit tests - only indirect coverage from
test/diff.test.ts exercising them at the diffTranscripts level.
methodOf is also exported but untested. Adding focused tests closes
this gap and makes regressions in these functions immediately
diagnosable rather than surfacing as mysterious diff failures.

What

  • New file test/match.keys.test.ts with 21 tests across three suites.
  • methodOf: returns method string for requests and notifications,
    undefined for responses.
  • requestKey: stable across param key order and request ids, strips
    volatile keys (timestamp, ts, requestId), differs on method and
    non-volatile params, handles no-params and no-method messages.
  • responseKey: stable across response ids and result key order,
    differs on result values and error codes, distinguishes result from
    error, strips volatile keys from results.

Tests

  • All 21 new tests in test/match.keys.test.ts.
  • Full suite: 111 passing (12 test files). Was 90 passing (11 files)
    before this PR.

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

requestKey and responseKey are exported from src/match.ts and used by
diffTranscripts, but had no dedicated unit tests. This adds
test/match.keys.test.ts covering: stable key across param key order,
volatile-key stripping (timestamp, ts, requestId), method inclusion,
result vs. error discrimination, and null/no-params edge cases.
@protosphinx protosphinx added the automated Opened by the daily bot label May 12, 2026 — with Claude
Copy link
Copy Markdown
Member Author

auto-deferred for human review: CodeQL SARIF status check stuck in queued state after extended wait

The primary CI results:

  • test: success
  • Analyze (actions) (the CodeQL scan job itself): success

The CodeQL check (SARIF result processing) has been in queued status for more than 10 minutes without resolving. Self-merge gate requires all checks to be non-pending. Safe to merge manually once CodeQL resolves or is confirmed neutral.


Generated by Claude Code

@protosphinx protosphinx added the needs-review PR awaiting human review label May 12, 2026 — with Claude
@protosphinx protosphinx merged commit 1732439 into main May 13, 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 needs-review PR awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant