7. Testing & Quality Standards
Current State
The test runner is Rstest (@rstest/core), configured by a single root rstest.config.ts. Test files live next to the file under test as *.test.ts.
Coverage is always collected with the v8 provider and written to coverage/ as text, html, and lcov.
Running Tests
pnpm test:agent has prerequisites:
pnpm build— the agent spawns the builtdist/server.jsnpx playwright install chromium— onceOPENAI_API_KEY(orSILICONFLOW_API_KEY,API_KEY) in the repository root.env
Critical Scenarios to Test
Testing Rules for New Code
- Whenever a new tool is added, write a unit test for its handler
- Add validation tests when parameter Zod schemas are added/changed
- Verify that the commands written in
README.mdandSKILL.mdactually work - Gate tests that need network or a browser behind
describe.skipIfso the default run stays fast
Quality Verification
Lint
- Uses the
@rslint/corets / js / import / unicorn recommended configs @typescript-eslint/no-explicit-anyis off (MCP SDK interface compatibility)
Formatting
Type Checking
- Root
tsconfig.jsonsets"noEmit": trueandstrict: true include: ["src"]— both sources and test files are checked
Build Verification
- Verifies tsup bundles all 3 entries (index, server, cli)
- Verifies DTS generation works
- Releases are handled by release-please (merging the release PR), so CI has no release dry-run step
CI Pipeline (.github/workflows/ci.yml)
Runs on every pull request targeting main and on pushes to main.
pnpm install --frozen-lockfilepnpm lintpnpm format:checkpnpm typecheckpnpm testpnpm build
Definition of "Done"
A change is complete when all of the following hold:
-
pnpm lintpasses -
pnpm format:checkpasses -
pnpm typecheckpasses -
pnpm testpasses -
pnpm buildcompletes successfully -
README.mdandskills/<bin>/SKILL.mdupdated by hand when a tool is added or changed - A decision log lands in
.claude/decisions/when the change touched a tool, a dependency, or the build config, made a design choice the docs do not dictate, or proceeded on an assumption because a question went unanswered — format in .claude/decision-log.md - Commit message follows Conventional Commits
- No unnecessary files (dist, node_modules, etc.) included in the commit
- When
src/common/changes, both consumers (MCP server, CLI) are verified