Code-aware analysis
Parses each component with ts-morph to understand props, hooks, context usage, and rendered output.
testgen is a local-first AI test generation tool. It reads your React components through static analysis and produces ready-to-run React Testing Library suites - entirely on-premises, with zero source code leaving your environment.
ts-morph extracts props, hooks, and JSX structure into a component profile.
A LoRA-tuned local model writes an RTL suite from the profile via Ollama.
renders balance for the user
Fully local, zero egress. The AST and the TypeScript compiler drive generation — no source code, no user data, no proprietary logic ever leaves your environment. A local model via Ollama is optional and only engages when the compiler cannot resolve a failure.
Parses each component with ts-morph to understand props, hooks, context usage, and rendered output.
An Ollama-hosted model runs on local hardware and is only invoked when the deterministic pass cannot resolve a failure — never by default.
Every stage - parsing, prompting, generation - executes on-premises, built for strict compliance environments.
Static analysis does the heavy lifting up front, so the model's job is focused: write meaningful assertions for behavior already mapped by the analyzer.
The target file is loaded into a ts-morph project. Props, exports, hooks, and JSX structure are extracted into a structured component profile.
The profile is enriched with repo conventions - test file placement, naming patterns, and the providers a component renders under.
The fine-tuned model produces a React Testing Library suite from the profile, covering render paths, interactions, and edge states.
The suite is written alongside the component, ready for the developer to run, review, and commit - developer always stays in the loop.
Developer targets a component file or folder - single file or batch.
Props, hooks, context, and JSX extracted into a component profile.
Fine-tuned DeepSeek-Coder writes assertions from the profile - 100% local.
Delivered next to the component - developer reviews, runs, commits.
Run testgen against any component file or folder. Batch mode generates suites across an entire feature set in one command.
A configurable provider layer supports local Ollama inference by default, with a pluggable design for evolving model strategy.
Targets lifting unit test coverage toward the 75%+ range, without writing boilerplate by hand.
Repo-specific conventions are captured in a portable testgen.skill package, benefiting every team that adopts the tool.
Typical pilot repo before adoption vs. the target range testgen is built to close, without hand-written boilerplate.
Per-component effort to reach a reviewed, passing test suite - writing assertions by hand vs. generating and reviewing.
# Single component $ testgen generate src/components/Button.tsx # Batch - entire feature folder $ testgen generate src/features --recursive # Output written next to each component ✓ Button.test.tsx generated ✓ Modal.test.tsx generated ✓ Form.test.tsx generated
The CLI writes test files next to their components, following each repository's existing naming and folder conventions.
| Layer | Technology | Runs where |
|---|---|---|
| Static analysis | ts-morph (TypeScript AST) | Local |
| Generation model | DeepSeek-Coder-1.3B - LoRA via Ollama | Local |
| Test framework | Jest + React Testing Library | Local |
| Interface | CLI | Local |
testgen follows a phased delivery model - each phase validated on real repositories before the next begins. We are currently in Phase 3.
Built the core static analysis pipeline using ts-morph to extract component structure into a reliable intermediate profile. CLI interface established.
Fine-tuned DeepSeek-Coder-1.3B via LoRA on curated codebase examples. Integrated Ollama for on-premises inference. Dual-provider architecture built for flexibility.
testgen has produced passing test suites across a growing set of pilot repositories. Each run tightens provider detection, environment setup, and convention alignment.
A decision-tree orchestration layer that routes each component through the optimal analysis depth and prompting approach, automatically.
Pipeline hooks that detect coverage gaps and propose candidate tests during pull requests, plus per-repo dashboards tracking uplift over time.