Rewrite testing code to a TestRunner managing dom context - #2679
Draft
WorldSEnder wants to merge 11 commits into
Draft
Rewrite testing code to a TestRunner managing dom context#2679WorldSEnder wants to merge 11 commits into
WorldSEnder wants to merge 11 commits into
Conversation
|
Visit the preview URL for this PR (updated for commit 2f351ec): https://yew-rs-api--pr2679-principled-testing-nahj86pn.web.app (expires Fri, 20 May 2022 22:34:59 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Size ComparisonDetails
|
29 tasks
2 tasks
This was referenced Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduces a
TestRunnerthat can mounts components, wait until they are done rendering, offers an API to test some properties about them and avoids mistakenly rendering over other running tests (should enable parallel testing, but this isn't yet available in the browser).Also gets rid of the timeout based version of waiting for events to complete, by abstracting it with a
TriggerBus(basically a global boolean flag that is used as the condition whether to suspend, or to await it until it turns "active"/true). Naming up for debate, feel free to bike-shed a bit, I'm not too keen on the name.Fixes the failures of this form: https://github.com/yewstack/yew/runs/6289299836?check_suite_focus=true that appear from time to time due a slow browser. See also #2609 (comment)
Net negative code size
Checklist