Test case generator
Generate a test-case matrix from code or requirements — normal, boundary and error paths — and get a runnable skeleton for Vitest, Jest, Pytest or Go test whose case count is verified against the matrix.
About this tool
Tests get skipped because writing the case list is the slow part, and the cases that get skipped are always the boundary and error paths. This generator measures your code structure locally — function names and branch counts — and builds a case matrix against it: normal, boundary and error cases, each with given, input and expected.
The matrix is then rendered into a runnable skeleton for Vitest, Jest, Pytest or Go test, one test per case with the setup written in as comments. Before you download, the skeleton is counted locally against the matrix — if a case went missing in rendering, the tool says so instead of handing you a partial file.
How to use Test case generator
- Add your provider API key in the key panel.
- Paste the function or module code (or a requirements paragraph) and pick the test framework.
- The code structure is measured locally; cases are generated against that structure — normal, boundary and error paths.
- Download the case matrix and the runnable test skeleton; the two are count-checked against each other.
Keep the original files and inspect the exported result before publishing or sharing it.
Frequently asked questions
How are the cases tied to my code?
Function names and branch counts are measured locally first and handed to the model as the structure to cover, so cases target real functions instead of generic advice.
Is the skeleton runnable?
It is a valid test file for the chosen framework with one test per case, the given/input/expected written in as comments, and a TODO marker where you wire up the call and assertion.
How do I know no case was lost?
The skeleton is counted locally after generation; if the count does not match the case matrix, the tool says so instead of handing you a partial file.
Where does my code go?
Only to the AI provider behind your own key, directly from your browser.
Related tools
- AI chat — Chat with OpenAI, Claude or Gemini using your own API key. Your key stays in your browser; requests go straight to the provider.
- AI summarizer — Summarize long text with your own OpenAI, Claude or Gemini API key. Brief, detailed or bullet-point summaries, all in your browser.
- AI translator — Translate text between 30 languages with your own OpenAI, Claude or Gemini API key. Private by design: key and text stay with you and the provider.
- AI writing assistant — Improve, expand, shorten or re-tone your writing with your own API key. Six editing modes, direct browser-to-provider calls.
- AI code explainer — Paste code and get a plain-English explanation using your own OpenAI, Claude or Gemini API key. Language auto-detect included.
- AI PDF chat — Upload a PDF and ask questions about it. The PDF is parsed in your browser; only the extracted text and your question go to your chosen AI provider.
- AI image analyzer — Upload an image and let AI describe it, extract text (OCR), or identify objects. Uses vision models from OpenAI, Claude or Gemini with your own key.
- AI voice generator — Turn text into natural-sounding speech with OpenAI TTS. Six voices, speed control, play in the browser and download MP3.
- AI data analyst — Upload a CSV and ask questions in plain English. The file is parsed locally; the AI sees only a schema summary and sample rows.
- AI spend analyzer — Turn your AI provider usage export into an independent cost receipt: per-model and per-day breakdowns, spike alerts and a monthly projection. Runs 100% in your browser — your billing data is never uploaded.