Skip to content

[Easy] Add zod schema unit tests for all 6 MCP tool input contractsΒ #9

@hoainho

Description

@hoainho

🌟 Before claiming this issue

Two quick steps before you open a PR:

  1. ⭐ Star the repository β€” low-friction signal that you'll follow through
  2. πŸ’¬ Comment I'll take this (or similar) below β€” prevents two contributors racing on the same issue

Full policy: CONTRIBUTING.md β†’ How to claim. If a claim is older than 7 days with no PR, you can reclaim it politely.


Context

MCP tools defined in openspec/changes/mcp-server-v1/specs/mcp-tools/spec.md use zod schemas for input validation. Each schema needs unit tests covering happy path plus invalid-input rejection so regressions are caught before hitting end-to-end.

Where to look

  • The 6 tools: list_inspected_tabs, get_fiber_node, get_issues, get_renders_for, analyze_performance, explain_redux_action
  • Implementation files: cli/src/tools/*.ts (created by tasks 4.1 to 4.5)
  • Add test files: cli/src/tools/*.test.ts using Vitest

Expected outcome

  • Each of the 6 tools has its own .test.ts file
  • Each file covers valid input parses correctly, every required-field-missing rejection, every wrong-type rejection
  • Tests use Vitest expect toThrow for rejection cases

Estimated effort

M (3 to 6h)

How to claim

Comment "@hoainho I will take this" to claim. PR within 10 days or unclaimed.

Acceptance criteria

  • npm test cli/src/tools passes with at least 18 test cases (3 per tool minimum)
  • Coverage report shows 100% line coverage on the zod schema definitions
  • CI workflow runs these tests on PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions