How It Works
ShipTested uses a multi-step pipeline to generate test suites that actually pass. Instead of producing tests that require manual fixes, it runs your tests locally and iterates until they are green.
The Generation Pipeline#
Every time you run shiptested generate, your code goes through six steps:
1. Analyze#
ShipTested scans your project to understand its structure. It detects your language (TypeScript or JavaScript), module system (ESM or CJS), framework (React, Next.js, Express, etc.), and test runner (Vitest or Jest). It also identifies which files are testable and classifies them by type: components, hooks, API routes, utilities, middleware, and more.
You can preview this step without generating anything by running:
shiptested analyze2. Generate#
For each testable file, ShipTested sends the source code and project context to Claude Sonnet, which creates a comprehensive test suite. The generated tests cover the main functionality, edge cases, and error handling paths for your code.
The AI understands your framework and generates tests that use the right patterns. For React components, it uses Testing Library. For API routes, it tests request/response cycles. For utility functions, it covers input variations and boundary conditions.
3. Run#
The generated test file is executed locally on your machine using your project's test runner (Vitest or Jest). Tests run in your actual environment with your real dependencies, not in a sandbox. This means the tests must work with your specific setup.
Each individual test has a 60-second timeout to prevent hangs from infinite loops or unresolved promises.
4. Fix#
If any tests fail, ShipTested sends the error output to Claude Haiku, which analyzes the failures and patches the test code. Common fixes include correcting import paths, adjusting mock setups, fixing assertion values, and handling async operations properly.
5. Iterate#
Steps 3 and 4 repeat in a loop until all tests pass or the maximum number of iterations is reached. The default is 3 iterations, but you can configure this:
shiptested generate --max-iterations 5ShipTested tracks the best result across all iterations. If iteration 2 had 8/10 tests passing but iteration 3 only has 7/10, it keeps the iteration 2 result as the best.
6. Report#
After generation completes, results are sent to the ShipTested dashboard. You can view test coverage, iteration history, error logs, and generated test code for every file in your project. This step is automatic and runs in the background.
Open your dashboard at any time:
shiptested dashboardSmart Behaviors#
ShipTested includes several automatic optimizations to produce better results with less configuration.
Framework-aware test infrastructure#
When ShipTested detects React or Next.js, it automatically provisions the test infrastructure you need: Vitest configuration, Testing Library setup, jsdom environment, and Next.js-specific mocks. You do not need to configure these manually.
File skipping#
Not every file needs tests. ShipTested automatically skips files that are not meaningfully testable:
- Type-only files (interfaces, type definitions)
- Barrel exports (index files that only re-export)
- Layout files and page wrappers with no logic
- Configuration files
Best iteration tracking#
The fix loop does not always converge. Sometimes fixing one test breaks another. ShipTested tracks the iteration with the most passing tests and uses that as the final result, even if later iterations regress.
Per-test timeout#
Each individual test case has a 60-second timeout. This prevents a single hanging test from blocking the entire generation process.
Supported Languages and Frameworks#
Languages#
| Language | Status | Module Systems |
|---|---|---|
| TypeScript | Fully supported | ESM, CJS |
| JavaScript | Fully supported | ESM, CJS |
| Python | Coming soon | - |
| Go | Coming soon | - |
Frameworks#
| Category | Frameworks |
|---|---|
| Full-stack | Next.js, Nuxt, Remix, Astro, SvelteKit |
| Frontend | React, Vue, Angular |
| Backend | Express, Fastify, Koa, Hono, NestJS |
Test Runners#
| Runner | Status | Notes |
|---|---|---|
| Vitest | Full support | Default and recommended |
| Jest | Full support | Automatic configuration |
| Mocha | Basic support | Limited auto-configuration |
File types detected#
ShipTested classifies your source files to generate appropriate test patterns for each type:
- Components – React, Vue, and Svelte components
- Hooks – React hooks (custom and composed)
- API routes – Next.js and Remix route handlers
- Middleware – Express, Koa, and Hono middleware
- Models and schemas – data validation and ORM models
- Utilities – pure functions, helpers, and shared logic
Next Steps#
- Getting Started – install and run your first generation
- CLI Reference – all commands and flags
- Configuration – customize behavior for your project
Was this page helpful?