-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Serialize 'expected' and 'actual' in isolation with regards to already seen values #51851
Serialize 'expected' and 'actual' in isolation with regards to already seen values #51851
Conversation
Review requested:
|
Do we have tests for this so we validate how it actually affects the output? |
This should probably have a test case with an actual and expected that both share an object - like: |
I have looked a bit around and it would seem that a test would go somewhere around here:
But I actually don't understand that existing test and I'm also a bit unsure about how to run the test using the binary I built at I tried using |
You can run it with the following command: |
Here's a test for this:
@aduh95 do you know what's the command that generates an updated snapshot file? I have tried |
@malthe if you can't find the command in the error output, you can always update the snapshot manually. |
try Lines 686 to 690 in db7d22d
|
Test added (squashed with first commit). |
thanks for fixing this! can you amend the first commit message? |
8ea3657
to
5c42ba6
Compare
@MoLow squashed/amended now thanks. |
5c42ba6
to
e29c56e
Compare
bump |
@MoLow not sure what these build failures are – they seem unrelated. |
352a556
to
628e39a
Compare
commits squashed |
@malthe can you also rebase ontop upstream/main? |
Previously, a value seen in 'actual' would be serialized as a circular reference if it had also appeared in 'expected'.
628e39a
to
e6b5a64
Compare
@MoLow rebased |
Landed in 3ef7117 |
Previously, a value seen in 'actual' would be serialized as a circular reference if it had also appeared in 'expected'. PR-URL: #51851 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Previously, a value seen in 'actual' would be serialized as a circular reference if it had also appeared in 'expected'. PR-URL: #51851 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Previously, a value seen in 'actual' would be serialized as a circular reference if it had also appeared in 'expected'. PR-URL: #51851 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Previously, a value seen in 'actual' would be serialized as a circular reference if it had also appeared in 'expected'. PR-URL: #51851 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Previously, a value seen in 'actual' would be serialized as a circular reference if it had also appeared in 'expected'. PR-URL: nodejs#51851 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This fixes an issue in the test runner output:
If this assertion is made during a test, the "expected" output will be correct while the "actual" output will contain the string "Circular":
With the change presented here, each output is produced in isolation from each other such that only circular references within each output will be shown as "Circular".