shiptested
v0.2.0
Published
AI-powered test generation for TypeScript and JavaScript projects
Downloads
1,828
Maintainers
Readme
shiptested
AI tests that actually pass.
shiptested generates tests for your TypeScript and JavaScript projects, runs them, fixes failures, and iterates until every test is green. Other tools just generate test files. ShipTested closes the loop.
Quick Start
npx shiptested generateInstallation
npm install -g shiptestedCommands
shiptested generate [path]
Generate, run, and fix tests for your project.
| Flag | Description |
|------|-------------|
| --files | Comma-separated list of specific files to test |
| --max-iterations | Maximum fix iterations (default: 3) |
| --framework | Override test framework: vitest, jest, or mocha |
| --ci | Non-interactive CI mode |
| --json | Output results as JSON |
| --all | Test all files in the project |
| --changed-only | Only test files changed in git |
| --diff-base | Git ref to diff against (default: HEAD~1) |
| --threshold | Minimum pass rate percentage to exit 0 (default: 100) |
# Generate tests for the current directory
shiptested generate
# Generate tests for a specific path
shiptested generate src/utils
# Only test changed files in CI
shiptested generate --changed-only --ci
# Set a minimum pass threshold
shiptested generate --threshold 80shiptested init [path]
Initialize a ShipTested configuration file.
| Flag | Description |
|------|-------------|
| --force | Overwrite existing config |
shiptested login
Authenticate with ShipTested.
| Flag | Description |
|------|-------------|
| --api-url | Custom API URL |
shiptested logout
Sign out from ShipTested.
Configuration
ShipTested looks for config files in this order:
shiptested.config.tsshiptested.config.js.shiptested.json"shiptested"key inpackage.json
Options
| Option | Description |
|--------|-------------|
| maxIterations | Maximum number of fix iterations |
| testFramework | Test framework to use (vitest, jest, mocha) |
| include | File patterns to include |
| exclude | File patterns to exclude |
| testDir | Directory for generated test files |
| colocate | Place test files next to source files |
| apiKey | Anthropic API key (alternative to login) |
Environment Variables
| Variable | Description |
|----------|-------------|
| SHIPTESTED_MAX_ITERATIONS | Override max iterations |
| SHIPTESTED_TEST_FRAMEWORK | Override test framework |
| ANTHROPIC_API_KEY | Use your own Anthropic API key directly |
Authentication
ShipTested supports two authentication modes:
ShipTested account: run
shiptested loginto authenticate. API calls are proxied through ShipTested servers. This is the recommended approach.Direct Anthropic API key: set the
ANTHROPIC_API_KEYenvironment variable or theapiKeyconfig option. API calls go directly to Anthropic.
Supported Frameworks
- React
- Next.js
- Express
- Hono
- TypeScript
- JavaScript
- Vitest
- Jest
Coming Soon
- Python (pytest)
- Vue
- Svelte
- Go
Links
- Website: https://www.shiptested.app
- GitHub: https://github.com/igorlourenco/shiptested
- Issues: https://github.com/igorlourenco/shiptested/issues
License
MIT
