File size: 911 Bytes
7149fa6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
---
description: Use the rule when agent need to write test suites.
globs:
alwaysApply: false
---
- Follow the AAA (Arrange-Act-Assert) pattern.
- Implement beforeEach/afterEach hooks for test setup and cleanup.
- Include positive and negative test cases, edge cases, and error handling scenarios.
- Group related tests into logical describe blocks.
- Implement Jest for testing with TypeScript
- Use Jest's expect assertions with clear error messages.
- Use descriptive test names with lowerCamelCase
- Organize tests in describe blocks for logical grouping
- Apply dependency injection patterns where applicable
- Use comments to tag tests with categories:
- Duration: `// @category DURATION: FAST | NORMAL | SLOW`
- Kind: `// @category KIND: UNIT_TEST | SMOKE_TEST | REGRESSION_TEST | PERFORMANCE_TEST`
- Purpose: `// @category PURPOSE: POSITIVE_SCENARIO | NEGATIVE_SCENARIO | PARAMETERS_CHECKING` |