Allow returning non-serializable values from waitFor#732
Merged
Conversation
Paul-Hebert
approved these changes
Aug 24, 2023
Contributor
Paul-Hebert
left a comment
There was a problem hiding this comment.
I don't have enough context to 100% understand these changes but I don't see any obvious issues and they seem reasonable to me.
| ^" | ||
| ^ | ||
| ------------------------------------------------------- | ||
| dist/cjs/index.cjs" |
Contributor
There was a problem hiding this comment.
Just double checking that it was expected for this test's output to change as well.
Member
Author
There was a problem hiding this comment.
I am not entirely sure why this changed (not sure why it was how it was before this PR) but yes this is the expected output
Merged
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.
Closes #633.
Previously, using
waitForonly would return values if they were serializable. (The new test would fail,waitForwould returnundefined). This is because our implementation ofwaitFordefers to Testing Library's in-browser implementation (uses MutationObserver + timers to watch for changes). Previously the return value got passed to the browser and back.In this PR, I changed the return value from the callback to never go to the browser and back, it just stays in node, so we don't have to worry about serialization or deserialization.