Skip to content

Standardize MCP tool dispatch test mocks #621

Open

Description

@cl0ckt0wer

Problem

PR #279 added and adjusted MCP tool dispatch coverage in test/mcp-tools-call.test.ts, but that test still uses hand-rolled SDK/KV stubs instead of the repo-standard vi.mock("iii-sdk") pattern documented in AGENTS.md.

PR: #279

Why this matters

  • Mocking patterns drift across the test suite.
  • Hand-rolled SDK/KV stubs can miss behavior covered by the shared mock setup.
  • Future MCP dispatch changes are easier to review when tests follow the same structure as the rest of the repo.

Proposal

Refactor test/mcp-tools-call.test.ts to use vi.mock("iii-sdk") and the same mocked sdk.trigger, sdk.registerFunction, sdk.registerTrigger, and kv.get/set/list shape used by nearby function tests.

Acceptance criteria

  • test/mcp-tools-call.test.ts uses the standard vi.mock("iii-sdk") pattern.
  • Local helper stubs are removed or reduced to minimal wrappers around the shared mock.
  • Existing MCP dispatch assertions remain covered.
  • npm test -- --run test/mcp-tools-call.test.ts passes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions