HomeDocumentation

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

1

Install the Extension

Install the Testly extension from your IDE's marketplace.

Open VS Code and navigate to the Extensions panel (Ctrl+Shift+X or Cmd+Shift+X on macOS). Search for "Testly" and click Install.

2

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.

  1. Click on the Testly icon in the sidebar
  2. Click "Sign In" button
  3. Complete authentication in your browser
  4. Return to your IDE - you're all set!
3

Initialize Your Project

Set up Testly in your project directory.

Terminal
npx testly init

Run the initialization command in your project root. This will create a testly.config.js file with your project settings.

4

Configure Test Settings

Customize Testly for your project needs.

testly.config.js
// 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,
  },
};
5

Generate Your First Tests

Let Testly analyze your code and generate tests.

Terminal
npx testly generate src/components/Button.tsx

You can generate tests for a specific file, directory, or your entire project:

# Single file
npx testly generate src/utils/helpers.ts
# Directory
npx testly generate src/components/
# Entire project
npx testly generate --all
6

Run and Validate Tests

Execute generated tests and view results.

Terminal
npx testly run

Testly 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 init

Initialize Testly in your project

--force--template <name>
testly generate <path>

Generate tests for files or directories

--all--watch--dry-run
testly run

Run generated tests

--coverage--verbose--filter <pattern>
testly analyze

Analyze code quality and coverage

--output <file>--format <json|html>
testly config

Manage configuration

--get <key>--set <key> <value>

Supported Languages & Frameworks

JavaScript

JestMochaVitest

TypeScript

JestVitestts-jest

Python

pytestunittestnose

Go

testingtestifyginkgo

Rust

cargo testproptest

Java

JUnitTestNGMockito