Configuration Guide
Learn how to configure AIToTest for your specific needs
Configuration File
AIToTest uses a configuration file (aitotest.config.js
) to customize its behavior. Here's a complete example with all available options:
module.exports = {
// Project Configuration
projectName: 'my-app',
testFramework: 'jest', // or 'mocha', 'cypress'
// Test Generation Settings
testGeneration: {
coverage: {
enabled: true,
threshold: 80,
excludePatterns: ['**/*.test.js', '**/*.spec.js']
},
output: {
directory: './tests',
template: 'default' // or 'detailed', 'minimal'
}
},
// AI Model Configuration
ai: {
model: 'advanced', // or 'basic', 'enterprise'
contextSize: 'auto', // or number of lines
customPrompts: {
beforeGeneration: 'Consider edge cases',
afterGeneration: 'Add performance tests'
}
},
// Integration Settings
integration: {
ci: {
enabled: true,
provider: 'github-actions' // or 'jenkins', 'gitlab-ci'
},
reporting: {
format: 'html', // or 'json', 'junit'
destination: './reports'
}
}
}
Configuration Options
Test Framework
Choose your preferred testing framework:
- Jest (default)
- Mocha
- Cypress
Coverage Settings
Configure code coverage requirements:
- Enable/disable coverage
- Set coverage thresholds
- Exclude patterns
AI Model Options
Customize the AI behavior:
- Model selection
- Context size
- Custom prompts
Integration Settings
Configure CI/CD integration:
- CI provider selection
- Report formatting
- Output destination
Environment Variables
AIToTest supports the following environment variables:
AITOTEST_API_KEY
- Your API authentication keyAITOTEST_ENV
- Environment (development/production)AITOTEST_DEBUG
- Enable debug loggingAITOTEST_CONFIG_PATH
- Custom config file path
Advanced Configuration
Custom Test Templates
Create your own test templates in ./templates
:
module.exports = {
templates: {
custom: {
test: (functionName) => `
describe('${functionName}', () => {
// Your custom template
});
`
}
}
}