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)
The integration tests in
expandAll-integration.test.tsandroundTrip-expand-collapse.test.tsuse fixedsetTimeoutdelays (1000ms, 500ms, 200ms) to wait for tree view operations. This makes tests slow and brittle. Consider:roundTrip-expand-collapse.test.tslines 58-63)awaitsinon) to control timing in unit testsOriginally posted by @Copilot in #12 (comment)