Instruction file imported from guigeng/cursor-template (
.cursor/rules/workflows/testing.mdc). Copyright stays with the author.
description: When writing or running tests globs: test.py,test.py,test.py
Testing Workflow Rules
Test Categories
Unit Tests
- Component isolation
- Input/output validation
- Error handling
- Edge cases
Integration Tests
- Component interaction
- API endpoints
- Database operations
- Authentication flows
UI Tests
- Component rendering
- User interactions
- State management
- Visual regression
End-to-End Tests
- User workflows
- System integration
- Performance metrics
- Error scenarios
Testing Guidelines
Framework Selection
- Jest for frontend
- Pytest for backend
- Playwright for E2E
- Screenshot utils for visual
Test Organization
- Clear test descriptions
- Proper setup/teardown
- Meaningful assertions
- Comprehensive coverage
actions:
-
type: enforce conditions:
- pattern: "describe.*it" message: "Use proper test structure"
- pattern: "expect.*to" message: "Include meaningful assertions"
-
type: suggest message: | When writing tests:
- Use clear descriptions
- Test edge cases
- Mock external services
- Clean up resources
- Maintain test data
metadata: priority: high version: 1.0