Skip to content

Integration tests - File watcher integration (90% coverage) #58

@johnproblems

Description

@johnproblems

Task: Integration tests - File watcher integration (90% coverage)

Description

Create integration tests for the file system watcher that monitors the .claude/epics/ directory for changes. Test file change detection, debouncing, event emission, and integration with data providers with 90% minimum coverage.

Acceptance Criteria

  • Tests verify file creation detection in .claude/epics/
  • Tests validate file modification detection
  • Tests check file deletion detection
  • Tests verify debouncing behavior (prevent excessive triggers)
  • Tests validate event emission to data providers
  • Tests check proper disposal and cleanup
  • Code coverage reaches minimum 90% (lines, branches, functions)
  • All tests pass consistently

Technical Details

  • Create test file: test/integration/services/fileWatcher.test.ts
  • Test scenarios:
    • Watcher initialization with correct glob pattern
    • File create event triggers refresh
    • File modify event triggers refresh
    • File delete event triggers refresh
    • Debouncing batches rapid changes (200-500ms)
    • Events filtered to .md files only
    • Watcher ignores non-epic/task files
    • Multiple rapid changes handled correctly
    • Watcher disposal stops monitoring
    • Integration with Epic/Task data providers
  • Use @vscode/test-electron for file system watcher API
  • Create temporary test directories and files
  • Simulate file system operations
  • Test debounce timing with clock manipulation
  • Verify event callbacks invoked correctly
  • Files affected: test/integration/services/*.test.ts (new)

Dependencies

  • Task 9 - File system watcher implementation completed
  • Task 3 - Testing infrastructure configured

Effort Estimate

  • Size: M
  • Hours: 6
  • Parallel: true

Definition of Done

  • Code implemented
  • Tests written and passing
  • Documentation updated
  • Code reviewed
  • Coverage report shows 90%+ coverage
  • File system integration validated

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions