Skip to content

Improve integration test timing: replace fixed sleeps with event-driven waiting or fake timers #17

Description

@doughgle

The integration tests in expandAll-integration.test.ts and roundTrip-expand-collapse.test.ts use fixed setTimeout delays (1000ms, 500ms, 200ms) to wait for tree view operations. This makes tests slow and brittle. Consider:

  • Polling with a timeout instead of fixed sleeps (pattern already partially used in roundTrip-expand-collapse.test.ts lines 58-63)
  • Exposing events/promises from the extension that tests can await
  • A fake timers library (e.g. sinon) to control timing in unit tests

Originally posted by @Copilot in #12 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions