Skip to content

No test suite: the tool registry ships on type-check + lint alone #64

Description

@yakimoto

Surfaced while adding the fleet product tools in #63 (wave-av/wave-context#72).

This repo has no tests: package.json declares build / dev / type-check / lint / prepublishOnly and no test script, and there are zero test files under src/. The whole gate is tsc --noEmit + eslint.

That's thin for what this package is. src/tools/index.ts is the single registry that drives both transports (stdio McpServer and the in-process Agent SDK server) — its own comment records that a hand-maintained parallel list previously "fabricated tool names" and sank sdk-server.ts. The duplicate-name guard that now prevents a repeat runs at import time and is only exercised if something imports the registry, which nothing in CI currently does.

Concretely untested today:

  • the registry's duplicate-name throw
  • every tool's URL/query construction (e.g. that optional args are omitted rather than sent as undefined)
  • error mapping — errorContent(status, body) vs a success path
  • getBaseUrl() (app host) vs getApiBaseUrl() (gateway host) not being crossed, which is exactly the class of mistake that produces a silent 404
  • rate-limit retry behavior in waveFetchWithRateLimit

None of this needs network: the valuable tests here are pure — build the request, assert the URL and headers, feed a stubbed response through the handler and assert the rendered text. A node --test + tsx setup (the convention wave-context already uses) would cover it without adding a heavy framework.

Suggested first increment

  1. Add "test": "node --import tsx --test src/**/*.test.ts" and wire it into the checks workflow.
  2. One test that imports allTools and asserts names are unique + the expected count — this alone re-arms the anti-drift guard in CI.
  3. Per-area tests asserting the request URL each tool builds, including that optional parameters are omitted when absent.

Filed rather than bundled into #63 so that PR stays a feature change instead of quietly introducing test infrastructure.

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

    needs-triageOn the board but missing Type/Area/Priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions