Files
satellite-provider/.cursor/rules/testing.mdc
T
Oleksandr Bezdieniezhnykh 3418e1fcde Refine coding standards and testing guidelines
- Updated coding rule descriptions for clarity and emphasis on readability, meaningful comments, and test verification.
- Adjusted thresholds for test coverage on business logic from 80% to 75%, aligning with the canonical reference in `cursor-meta.mdc`.
- Enhanced guidelines for handling skipped tests, emphasizing the need for investigation and classification.
- Introduced completeness audit requirements for research decomposition to ensure thoroughness in addressing problem dimensions.
2026-04-17 20:28:37 +03:00

16 lines
1.2 KiB
Plaintext

---
description: "Testing conventions: Arrange/Act/Assert structure, naming, mocking strategy, coverage targets, test independence"
globs: ["**/*test*", "**/*spec*", "**/*Test*", "**/tests/**", "**/test/**"]
---
# Testing
- Structure every test with Arrange / Act / Assert section comments using language-appropriate syntax (`# Arrange` for Python, `// Arrange` for C#/Rust/JS/TS)
- One assertion per test when practical; name tests descriptively: `MethodName_Scenario_ExpectedResult`
- Test boundary conditions, error paths, and happy paths
- Use mocks only for external dependencies; prefer real implementations for internal code
- Aim for 75%+ coverage on business logic; 100% on critical paths (code paths where a bug would cause data loss, security breaches, financial errors, or system outages — identify from acceptance criteria marked as must-have or from security_approach.md). The 75% threshold is canonical — see `cursor-meta.mdc` Quality Thresholds.
- Integration tests use real database (Postgres testcontainers or dedicated test DB)
- Never use Thread Sleep or fixed delays in tests; use polling or async waits
- Keep test data factories/builders for reusable test setup
- Tests must be independent: no shared mutable state between tests