feat(preferred): add wait-for-expect replacements - #1109
Conversation
|
Hi @43081j and @dreyfus92, thanks again for your feedback on #1105! When you have time, I'd appreciate your review of this PR and whether the mapping and migration guide follow the project's guidelines and fit its preferred structure. If you spot a missed case, a compatibility concern, or a simpler approach, please point it out — I'm happy to make any changes needed to align with the project's requirements. If you have any questions about the changes or validation, please feel free to ask. Thanks for your time! |
|
we appreciate your efforts, but please stop pinging us. also please respect the pr's template, your agent shouldn't be overwriting it. we will review it eventually when time & energy matches, thanks again ✌🏻 |
|
Thanks for pointing that out; I will update the PR documentation to comply with the repository's rules as soon as possible. Also, I won't tag you unless you let me know that it's allowed in a specific case; I apologize for that and really appreciate the feedback. We're in this together to drive improvements. |
Closes #1099.
Add
wait-for-expectto the preferred manifest, mapping it to the existingnode:testandvitestreplacements. Projects already using either runner can remove the extra dependency and use the runner's built-in assertion retries.The migration guide shows how
waitForExpect(checkReady, 4500, 50)becomesvi.waitFor(checkReady, { timeout: 4500, interval: 50 })ort.waitFor(checkReady, { timeout: 4500, interval: 50 }). Both examples preserve asynchronous assertion callbacks andawait. The guide explains that callbacks must throw or reject to trigger a retry; returningfalsealone does not cause another attempt.The explicit options preserve the package's default timeout and interval. Both runners otherwise default to a shorter 1,000 ms timeout, and matching settings does not guarantee identical scheduling or timeout behavior. The guide also documents minimum versions and Vitest's automatic advancement of fake timers.
One commit changes only
manifests/preferred.jsonanddocs/modules/wait-for-expect.md.Validation
git diff --checkpassed using Node 24.18.0 and pnpm 10.33.3.wait-for-expect4.0.0, Vitest 0.34.5 and 5.0.0, andnode:test. All six runner/version combinations passed on Node 22.22.2 and 24.18.0, including examples with readiness delayed beyond the runners' default one-second timeout.preferredReplacementsandallexports, replacement references, and documentation URL.9d94d9f: the Node 20.x, 22.x, 24.x, and latest build/lint matrix, plus PR validation.Implementation assisted by AI tools.