Skip to content

neelra8n/neta

Repository files navigation

NETA: Next.js Exhaustive Testing Agent

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.

Features

  • 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.

Installation

npm install -g neta_cli

Or run directly with npx:

npx neta_cli --help

Quick Start

  1. Initialize NETA in your Next.js project root:

    npx neta init
  2. Configure LLM Settings (Optional but recommended):

    npx neta config

    Follow the prompts to select a provider (Local/OpenAI/Anthropic) and set your API key.

  3. Generate Tests:

    npx neta generate --mode changed

    Currently supported modes: changed (stub), all, file.

  4. Run Checks:

    npx neta check

Configuration

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.json is in your .gitignore if you store API keys in it.

Commands

  • 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.

License

MIT

About

Next.js Exhaustive Testing Agent

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors