condition-based-waiting
CommunityEliminate flaky tests, wait for actual state changes.
AuthorAlabamaMike
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Flaky tests often rely on arbitrary setTimeout or sleep calls, guessing at timing. This creates race conditions, leading to inconsistent pass/fail results, especially under load or in CI. This skill replaces these unreliable delays with condition-based polling, ensuring tests wait for actual state changes, making them robust and reliable.
Core Features & Use Cases
- Reliable Async Testing: Replaces arbitrary timeouts with polling for specific conditions.
- Flaky Test Elimination: Prevents race conditions and inconsistent test failures.
- Generic Polling Function: Provides a reusable
waitForutility for various conditions (events, state, counts, file existence). - Use Case: If your UI tests are intermittently failing due to elements not being ready, use this skill to implement
waitForfunctions that poll for the element's visibility or state, making your tests stable.
Quick Start
Use the condition-based-waiting skill to refactor the 'user-login.test.ts' file, replacing setTimeout calls with condition-based waits for UI elements.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: condition-based-waiting Download link: https://github.com/AlabamaMike/copilot-agents/archive/main.zip#condition-based-waiting Please download this .zip file, extract it, and install it in the .claude/skills/ directory.