Generate unit or integration tests for specified code.
Generates unit or integration tests for specified code with comprehensive coverage.
/plugin marketplace add marcel-Ngan/ai-dev-team/plugin install marcel-ngan-ai-dev-team@marcel-Ngan/ai-dev-teamGenerate unit or integration tests for specified code.
/test-gen [target] [--type unit|integration|both]
Arguments:
target - File path, function name, or module to test--type - Test type (default: unit)/test-gen src/services/auth.ts
/test-gen src/api/users.ts --type integration
/test-gen UserService.authenticate --type both
Analyzes the target code to understand:
Generates tests covering:
Outputs test file with:
describe('TargetFunction', () => {
describe('when valid input', () => {
it('should return expected result', () => {
// Test implementation
});
});
describe('when invalid input', () => {
it('should throw appropriate error', () => {
// Test implementation
});
});
describe('edge cases', () => {
it('should handle boundary condition', () => {
// Test implementation
});
});
});
testing-unit - For unit teststesting-integration - For integration testsgeneration-test-cases - For test case designUse the QA Engineer agent when: