TESTING
COMPREHENSIVE TEST COVERAGE
Documentation of FYT's testing strategy, test suites, coverage metrics, and quality assurance procedures.
TESTING OVERVIEW
Multi-layered testing strategy
FYT employs a comprehensive testing strategy across multiple layers:
Test Layers:
- Content Validation - YAML structure and markdown heading checks
- Component Tests - React component unit tests
- Accessibility Tests - a11y compliance testing
- Integration Tests - End-to-end workflows
- Performance Tests - Lighthouse CI metrics
Coverage Goals:
- Content validation: 100% (achieved)
- React components: 80%+ (current: 250+ tests)
- Go CLI: 80%+ (current: ~300 tests)
- Accessibility: Critical components (achieved)
- Integration: Key user flows
TEST SUITES
Available test commands
Run All Tests:
BASH
npm run testContent Validation Tests:
BASH
npm run test:validateReact Component Tests:
BASH
npm run test:watchAccessibility Tests:
BASH
npm run lighthouse:ciPerformance Tests:
BASH
npm run lighthouse:ciFull CI Suite:
BASH
npm run a11y:ciCONTENT VALIDATION TESTING
YAML validation test suite
Test Coverage: 100%
The content validation test suite (
scripts/test-validate-content.sh) provides comprehensive coverage:Tests Included:
✅
Valid YAML files pass validation
✅
Markdown headings in content are detected
✅
Headings in code blocks are ignored
✅
Multiple headings are detected
✅
Missing meta fields trigger warnings
✅
Empty content fields are valid
✅
Whitespace-only content is valid
✅
Nested YAML examples are ignored
✅
Mixed valid/invalid sections fail
✅
Bold text (not headings) passes
✅
Large files (100+ sections) perform well
✅
Invalid YAML syntax handling
Run Tests:
BASH
npm run test:validateTest Results:
TEXT
Total tests: 12
Passed: 12
Failed: 0
✓ All tests passed!