# @paretools/test

[![npm](https://img.shields.io/npm/v/@paretools/test.svg)](https://www.npmjs.com/package/@paretools/test)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Dave-London/Pare/blob/main/LICENSE)

**Structured, token-efficient test runner output for AI agents.** Up to 80% fewer tokens than raw test CLI output.

Part of the [Pare](https://github.com/Dave-London/Pare) suite of MCP servers. Auto-detects pytest, jest, vitest, and mocha.

## Tools (3)

| Tool         | Description                                             |
| ------------ | ------------------------------------------------------- |
| `run`        | Run tests, returns pass/fail counts and failure details |
| `coverage`   | Run tests with coverage, returns per-file summary       |
| `playwright` | Run Playwright tests with structured pass/fail output   |

## Quick Start

```bash
npx -y @paretools/test
```

Add to your MCP client config:

```json
{
  "mcpServers": {
    "pare-test": {
      "command": "npx",
      "args": ["-y", "@paretools/test"]
    }
  }
}
```

## Example

**`run` output:**

```json
{
  "framework": "vitest",
  "passed": 46,
  "failed": 1,
  "skipped": 0,
  "total": 47,
  "failures": [
    {
      "name": "parseOutput > handles empty input",
      "file": "src/__tests__/parsers.test.ts",
      "message": "expected true to be false"
    }
  ]
}
```

## Timeout Policy

- Tool process timeout (`run`, `coverage`, `playwright`): `300_000ms` (5 minutes)
- Integration test MCP call timeout: `300_000ms`
- Vitest file/test timeout for this package: `300_000ms`

This package runs real downstream suites (including `@paretools/git` integration tests), so lower global limits like 120s can fail due to cumulative runtime on slower CI/Windows runners.

## Pytest Interpreter Resolution

For `framework: "pytest"`, `run` and `coverage` use the shared Python interpreter resolver. Pare checks `.venv/`, `venv/`, and `env/` under the requested `path` before falling back to `python` and then `python3`, and invokes pytest as `python -m pytest`.

Use the `interpreter` input to point at a specific Python executable when auto-detection is not enough.

## Test Batching (Maintainers)

- `pnpm test:unit` runs fast parser/formatter/helper tests
- `pnpm test:integration` runs MCP integration + tool-params tests
- `pnpm test:fidelity` runs the long fidelity suite

The default `pnpm test` runs these batches sequentially for earlier failure and clearer triage.

## All Pare Servers (244 tools)

| Package                                                              | Tools                                                                       | Wraps                                   |
| -------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------- |
| [@paretools/git](https://www.npmjs.com/package/@paretools/git)       | status, log, diff, branch, show, add, commit, push, pull, checkout          | git                                     |
| **@paretools/test**                                                  | run, coverage, playwright                                                   | pytest, jest, vitest, mocha, playwright |
| [@paretools/npm](https://www.npmjs.com/package/@paretools/npm)       | install, audit, outdated, list, run, test, init                             | npm                                     |
| [@paretools/build](https://www.npmjs.com/package/@paretools/build)   | tsc, build, esbuild, vite-build, webpack                                    | tsc, esbuild, vite, webpack             |
| [@paretools/lint](https://www.npmjs.com/package/@paretools/lint)     | lint, format-check, prettier-format, biome-check, biome-format              | eslint, prettier, biome                 |
| [@paretools/python](https://www.npmjs.com/package/@paretools/python) | pip-install, mypy, ruff-check, pip-audit, pytest, uv-install, uv-run, black | pip, mypy, ruff, pytest, uv, black      |
| [@paretools/docker](https://www.npmjs.com/package/@paretools/docker) | ps, build, logs, images, run, exec, compose-up, compose-down, pull          | docker, docker compose                  |
| [@paretools/cargo](https://www.npmjs.com/package/@paretools/cargo)   | build, test, clippy, run, add, remove, fmt, doc, check                      | cargo                                   |
| [@paretools/go](https://www.npmjs.com/package/@paretools/go)         | build, test, vet, run, mod-tidy, fmt, generate                              | go, gofmt                               |

## Compatible Clients

Works with any MCP-compatible client: [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Claude Desktop](https://claude.ai/download), [Cursor](https://cursor.com), [Windsurf](https://codeium.com/windsurf), [VS Code / GitHub Copilot](https://code.visualstudio.com), [Cline](https://github.com/cline/cline), [Roo Code](https://roocode.com), [Zed](https://zed.dev), [Continue.dev](https://continue.dev), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [OpenAI Codex](https://openai.com/index/codex/)

## Links

- [Pare monorepo](https://github.com/Dave-London/Pare)
- [MCP protocol](https://modelcontextprotocol.io)

## License

[MIT](https://github.com/Dave-London/Pare/blob/main/LICENSE)
