Specwatch
Generate and check JavaScript tests from your terminal
A local-first AI testing CLI for JavaScript and TypeScript projects. Generate tests from source files, run them through Jest or Vitest, and inspect coverage reports.
Visit Specwatch → View the changelog →Getting started
Requirements
- Download the CLI archive and install it in a Node.js 22.12 or newer JS/TS project
- Run Ollama locally or explicitly configure a cloud model provider
- Use Jest or Vitest and supply an Istanbul coverage-final.json for coverage checks
Things to know
- The CLI archive is public; repository source access is separate
- Runs in your own project; a hosted testing service is not included
- gen and watch replace an existing test only with --overwrite, after the candidate passes
- Coverage checks require a pre-generated Istanbul report; missing or malformed reports fail explicitly
- A passing generated file does not prove useful assertions or a coverage gain
Vision
Specwatch helps developers draft tests alongside source changes and run the generated files through an existing test runner. Generated code still needs developer review.
The Problem
Writing and maintaining tests can lag behind source changes. A local CLI can reduce the work of drafting tests and point to gaps in an existing coverage report.
Key Differentiators
- Local default: Ollama is the default model provider; cloud providers require an explicit choice and credentials.
- Execution result: The runner returns whether a generated test file passed. The number of
test(...)calls detected in model output is not an executed pass count. - Scope: The current parser and runner cover JavaScript and TypeScript with Jest or Vitest. Coverage reporting reads an existing Istanbul JSON artifact.
Use it in your project
Download the CLI archive from the public homepage, check its SHA-256 checksum, and install it in your project with npm install --save-dev ./specwatch-0.1.0.tgz. Run the installed command with Node.js 22.12 or newer.
gen --dry-run preserves files. gen and watch keep existing sibling tests unless --overwrite is passed, and fix replaces a failing test only with a candidate that passes the runner; review the resulting diff. Generate an Istanbul coverage report before using ci --coverage: missing or malformed coverage input fails explicitly, while valid measured function locations are accepted. The existing test runner still determines test success. Specwatch runs locally; it does not provide a hosted testing service.