Tortest - AI-Powered Test Generator
Generate comprehensive test suites for your JavaScript and TypeScript projects using AI.
🚀 Features
- AI-Powered Test Generation: Automatically generate unit and integration tests using advanced AI models
- Multi-AI Provider Support: Works with OpenAI, Anthropic Claude, and Google Gemini
- Smart Project Analysis: Analyzes your project structure and dependencies to create contextual tests
- Flexible Test Organization: Multiple test file organization strategies (mirror, flat, alongside)
- Configurable Test Framework Detection: Automatically detects and adapts to your testing framework
- Dependency Analysis: Deep dependency analysis for better test context
- Concurrent Processing: Generate tests for multiple files simultaneously
📋 Requirements
- VS Code 1.85.0 or higher
- Node.js project with JavaScript or TypeScript
- API key from one of the supported AI providers:
- OpenAI API key
- Anthropic Claude API key
- Google Gemini API key
🛠️ Installation
- Install the extension from the VS Code Marketplace
- Open a JavaScript/TypeScript project in VS Code
- Run the command
Tortest: Manage User Keys
to set up your AI provider API key
⚙️ Configuration
Extension Settings
Configure Tortest through VS Code settings (Ctrl/Cmd + ,
and search for "Tortest"):
Setting |
Default |
Description |
tortest.maxGenerationRetries |
5 |
Maximum retries for test generation (1-20) |
tortest.maxConcurrentCalls |
3 |
Maximum concurrent AI API calls (1-10) |
tortest.dependencyAnalysisDepth |
2 |
Depth of dependency analysis (1-10) |
tortest.testDirectory |
__tests__ |
Directory for generated test files |
tortest.testFileSuffix |
"" |
Custom suffix for test files (e.g., .spec , .test ) |
tortest.testFileOrganization |
mirror |
Test file organization strategy |
tortest.createLoggingFolder |
false |
Create logging folders for debugging |
Test File Organization Options
mirror
: Mirrors source structure in test directory
src/components/Button.tsx
→ __tests__/components/Button.test.tsx
flat
: All tests in test directory root
src/components/Button.tsx
→ __tests__/Button.test.tsx
alongside
: Tests next to source files
src/components/Button.tsx
→ src/components/Button.test.tsx
🎯 Usage
Quick Start
Set up API Key:
Ctrl/Cmd + Shift + P → "Tortest: Manage User Keys"
Generate Tests:
Ctrl/Cmd + Shift + P → "Tortest: Analyse and Test"
Key Management
The extension provides a comprehensive key management system:
- Add Existing Key: Enter your API key manually
- Create New Account: Opens browser for account creation (coming soon)
- Manage Keys: View, activate, or delete stored keys
- Multiple Keys: Store and switch between different API keys
Test Generation Process
- Project Analysis: Scans your project structure and identifies testable files
- AI Path Selection: Uses AI to intelligently select relevant files for testing
- Content Loading: Loads file contents and analyzes dependencies
- Readiness Evaluation: Ensures all prerequisites are met
- Test Generation: Creates comprehensive test suites using AI
- Setup Documentation: Generates README with setup instructions
🧪 Supported Languages & Frameworks
Languages
- JavaScript (ES6+)
- TypeScript
Testing Frameworks
Auto-detects and supports:
- Jest
- Vitest
- Mocha
- Jasmine
- And more...
📁 Project Structure
The extension creates the following structure:
your-project/
├── __tests__/ # Generated test files
│ ├── components/
│ └── utils/
├── tortest/ # Logging (optional)
│ ├── session-logs/
│ ├── analysis/
│ ├── prompts/
│ └── errors/
└── tortest-manifest.json # Project analysis cache
🔧 Advanced Features
Dependency Analysis
- Analyzes import/export relationships
- Identifies external dependencies
- Creates contextual test scenarios
- Configurable analysis depth (1-10 levels)
Concurrent Processing
- Processes multiple files simultaneously
- Configurable concurrency limits
- Rate limiting protection
- Progress tracking
Intelligent Caching
- Caches project analysis in
tortest-manifest.json
- Incremental updates for changed files
- Faster subsequent test generations
🐛 Troubleshooting
Common Issues
"No workspace folder open"
- Ensure you have a folder open in VS Code, not just individual files
"API key not found"
- Run
Tortest: Manage User Keys
to add your API key
- Ensure the key is set as active
"Unsupported file type"
- Currently supports only JavaScript and TypeScript files
- Check that your files have
.js
, .ts
, .jsx
, or .tsx
extensions
Rate limiting errors
- Reduce
maxConcurrentCalls
in settings
- Some AI providers have strict rate limits
Debug Mode
Enable logging by setting tortest.createLoggingFolder
to true
. This creates detailed logs in the tortest/
directory for troubleshooting.
🤝 Contributing
We welcome contributions! Please see our contributing guidelines for more information.
📄 License
This extension is licensed under the MIT License.
🆘 Support
- Issues: Report bugs and request features on our GitHub repository
- Documentation: Visit our website for detailed guides
- Community: Join our Discord server for community support
Happy Testing! 🎉
Generate comprehensive, AI-powered tests for your JavaScript and TypeScript projects with Tortest.