resume/.cursor/rules/test-suite-integrity.mdc

27 lines
1.9 KiB
Plaintext

---
description:
globs:
alwaysApply: false
---
# Test Suite Integrity Rule
This rule ensures that the test suite for the project contains meaningful tests that perform actual checks and validations, rather than being empty placeholder boilerplate. All tests MUST do SOMETHING significant to verify the functionality, security, or performance of the application.
## Guidelines to Follow
1. **Non-Empty Tests**: Every test file in the `tests/` directory must contain at least one test case that performs a specific validation or check. Empty test files or test cases with no assertions are not allowed.
2. **Meaningful Assertions**: Each test must include assertions or expectations that verify the behavior of the application. Tests should not simply run without checking outcomes (e.g., no empty `expect()` calls or trivial assertions like `expect(true).toBe(true)`).
3. **Coverage of Key Features**: The test suite must cover critical aspects of the application, including but not limited to:
- Accessibility (WCAG compliance)
- Security headers and CSP compliance
- Functional features like the PDF download button
- Performance metrics (via tools like Lighthouse)
4. **Regular Review**: Before running `build-test-deploy.sh`, review the test suite to ensure no placeholder or boilerplate tests remain. If a test is temporarily skipped or incomplete, it must be annotated with a clear `TODO` comment explaining the reason and a plan for completion.
5. **Automation in Build Script**: If possible, add a pre-test step in `build-test-deploy.sh` to scan test files for empty or placeholder content (e.g., using grep to detect empty test blocks or missing assertions) and fail the build if such issues are found.
## Relevant Files and Directories
- [tests/](mdc:tests)
- [build-test-deploy.sh](mdc:build-test-deploy.sh)
This rule must be adhered to in order to maintain a robust and reliable testing framework that ensures the quality and security of the application.