Skip to content

Tests are never typechecked (12 latent TS errors) and CI skips typecheck entirely #35

Closed

Description

@TMHSDigital

Why it matters

The tests compile with type errors today and nothing catches it. npm run typecheck is listed as a required check in CONTRIBUTING.md, but CI never runs it, and it wouldn't cover the tests even if it did.

Evidence

  • tsconfig.json excludes src/**/__tests__/**, so npm run typecheck never sees the test files. Vitest strips types without checking them.
  • .github/workflows/ci.yml runs npm run build and npm test only, with no typecheck step.
  • Typechecking the tests with a tsconfig that includes them gives 12× TS2345 in src/__tests__/share-ping.test.ts (lines 40, 69, 89, 107, 116, 153, 171) and src/__tests__/sshconfig.test.ts (113, 126, 158). The SDK's callTool return type is a union that includes the legacy { toolResult } shape, and the tests pass it straight to a helper typed { content?: unknown }.

Suggested approach

  • Add tsconfig.test.json (extends the base, noEmit, includes the tests), and have typecheck run both configs.
  • Fix the helper: narrow with CallToolResultSchema.parse(...) or use client.callTool(..., CallToolResultSchema).
  • Add npm run typecheck to ci.yml.
  • Optionally turn on vitest --coverage and publish the summary in the job output.

Done when

npm run typecheck covers src/** including the tests and passes, and CI fails on a type error in a test file.

Activity

  1. added
    bug
    ci
    priority: P2
    tests
    on Oct 25, 2026
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

    bugcipriority: P2tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions