Skip to content

[finding] handleGraphQL test doubles and a stale anonymous-deny comment outlive the removed /graphql route #10835

Description

@claude

Observation filed while implementing #10710, which explicitly parked it: "Test doubles
outliving a removed route may be worth a finding — file it, do not fix it here."

The residue

/graphql was removed from the runtime dispatcher — packages/runtime/src/http-dispatcher.ts:2026
is // /graphql removed — GraphQL is not in the product plan (#2462 follow-on), and there is
no handleGraphQL anywhere in packages/runtime. Three test-side survivors still declare it:

  • packages/adapters/hono/src/__mocks__/runtime.ts:6handleGraphQL = vi.fn().mockResolvedValue({ data: {} });
  • packages/adapters/hono/src/hono-wildcard-fallthrough.test.ts:37handleGraphQL: vi.fn(),
  • packages/adapters/hono/src/hono.test.ts:10handleGraphQL: vi.fn().mockResolvedValue({ data: {} }),

Plus one stale comment on the code side:

Why it is worth a card rather than a shrug

A double that declares a method the real subject no longer has is a double that can never
diverge from the subject — the test asserting against it is pinned to a shape nothing
implements, and it stays green by construction. It also reads, to the next author grepping
handleGraphQL, as evidence that the runtime still has the method: the mock is the only
non-CHANGELOG hit in packages/** once #10710 lands, which is exactly how the doc claim
this came from survived as long as it did.

Whether the doubles should shrink is a real question, not an obvious yes — a wildcard
fall-through test may want a method the dispatcher does not route, precisely to prove it
falls through. That is worth someone deciding deliberately rather than by default. The
anonymous-deny.ts:7 comment has no such defence.

Related in kind, different defect: #9165 (a partial test double discovered only by deleting
the catch that hid it).

Back-links: #10710, #10583


Generated by Claude Code


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions