-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding iterator to binary tree structure breaks representation #76
Comments
There doesn't seem to be an error though — what am I looking for? |
There are two different outputs, the second one has a lot of duplicated data in value, which is invalid tree structure. The output should be the same after adding the iterator. |
The output for second print should be:
I don't understand what those other data suppose to be, why they are duplicated? |
Also what is |
Note that I only want to know if the output is correct. So I can finally be sure that my tests that use snapshots are working after adding iterator. Because the snapshot says the output is different and that tests are broken. |
Gotcha, I think I tried to answer this in the original AVA issue but it got lost in the confusion around snapshots failing and then passing. Sorry for the confusion! Concordance / AVA does iterate over objects when serializing / Generally this is nice, in that custom iterables may have a couple fields and yield a bunch of items. In your case it's confusing because the iteration yields the same values as are available directly on the object (I think?). avajs/ava#1861 may be of interest, it would let you extend AVA to recognize your objects and format / compare them as appropriate. |
Thanks for the explanation, yes the iteration return the same values as are in objects properties. They are linked lists and iteration just returns an array of the items in that list. Thanks again for taking the time to think about my issue. |
This is related to avajs/ava#2811
Here is simple reproducation:
Here is the output:
The text was updated successfully, but these errors were encountered: