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 test
Content Validation Tests:
BASH
npm run test:validate
React Component Tests:
BASH
npm run test:watch
Accessibility Tests:
BASH
npm run lighthouse:ci
Performance Tests:
BASH
npm run lighthouse:ci
Full CI Suite:
BASH
npm run a11y:ci

CONTENT 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:validate
Test Results:
TEXT
Total tests:    12
Passed:         12
Failed:         0

✓ All tests passed!