NETA is a CLI tool that automates the testing workflow for Next.js (App Router) projects. It generates unit, integration, and E2E tests using LLMs, sets up testing infrastructure, and enforces coverage thresholds.
- Auto-Setup: Installs Vitest, Playwright, and configures them automatically.
- LLM-Powered Generation: Write tests for your Components, Pages, and Actions using local or cloud LLMs.
- Coverage Enforcement: Ensures your project meets specific coverage goals.
npm install -g neta_cliOr run directly with npx:
npx neta_cli --help-
Initialize NETA in your Next.js project root:
npx neta init
-
Configure LLM Settings (Optional but recommended):
npx neta config
Follow the prompts to select a provider (Local/OpenAI/Anthropic) and set your API key.
-
Generate Tests:
npx neta generate --mode changed
Currently supported modes:
changed(stub),all,file. -
Run Checks:
npx neta check
NETA stores configuration in .neta.config.json.
Supported LLM Providers:
- Local: Uses local models (e.g., via Ollama/LocalAI). No API key required.
- OpenAI: Requires
OPENAI_API_KEY. - Anthropic: Requires
ANTHROPIC_API_KEY.
Note: Ensure
.neta.config.jsonis in your.gitignoreif you store API keys in it.
neta init: Scaffolds testing infrastructure.neta config: Interactively configure LLM provider and keys.neta generate: Generates tests.-m, --mode <mode>:all|file|changed-f, --file <path>: Specific file to test.--e2e: Enable E2E test generation (Playwright).--dry-run: Print generated code without writing.
neta check: Runs tests and validates coverage.
MIT