Getting Started with Testly
Learn how to install, configure, and use Testly to automatically generate and run tests for your codebase.
Introduction
Testly is an AI-powered testing agent that analyzes your codebase and automatically generates comprehensive test cases. It supports multiple programming languages and testing frameworks, making it easy to achieve high test coverage with minimal effort.
New to Testly?
Start with our Quick Start Guide to get up and running in under 5 minutes.
Installation Guide
Authenticate Your Account
Sign in to connect your Testly account.
After installation, click on the Testly icon in the sidebar and sign in with your account. You can create a free account if you don't have one.
- Click on the Testly icon in the sidebar
- Click "Sign In" button
- Complete authentication in your browser
- Return to your IDE - you're all set!
Initialize Your Project
Set up Testly in your project directory.
npx testly initRun the initialization command in your project root. This will create a testly.config.js file with your project settings.
Configure Test Settings
Customize Testly for your project needs.
// testly.config.js
module.exports = {
// Test framework (jest, mocha, vitest, pytest)
framework: 'jest',
// Directories to analyze
include: ['src/**/*.{js,ts,jsx,tsx}'],
// Directories to exclude
exclude: ['node_modules', 'dist', '.git'],
// Output directory for generated tests
outputDir: '__tests__',
// Coverage threshold
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
// AI model preferences
ai: {
model: 'gpt-4',
temperature: 0.3,
maxTokens: 2048,
},
};Generate Your First Tests
Let Testly analyze your code and generate tests.
npx testly generate src/components/Button.tsxYou can generate tests for a specific file, directory, or your entire project:
npx testly generate src/utils/helpers.ts
npx testly generate src/components/
npx testly generate --all
Run and Validate Tests
Execute generated tests and view results.
npx testly runTestly will run all generated tests and provide detailed results including coverage reports, failed tests, and suggestions for improvement.
✓ 47 tests passed
✗ 2 tests failed
○ 3 tests skipped
Coverage: 94.2% | Time: 3.21s
CLI Reference
testly initInitialize Testly in your project
testly generate <path>Generate tests for files or directories
testly runRun generated tests
testly analyzeAnalyze code quality and coverage
testly configManage configuration
Supported Languages & Frameworks
JavaScript
TypeScript
Python
Go
Rust
Java
Next Steps
Now that you have Testly installed, here are some things you can do: