-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
VisualStudioReporter incorrect comparison order of approved and received? #549
Comments
changing If you want to change this, it should be a PR in https://github.com/VerifyTests/DiffEngine that inverts the display order via an environment setting |
@SimonCropp, thank you that you corrected my mistake of the design. ApprovalTests.Net/src/ApprovalTests/Reporters/DiffToolReporter.cs Lines 15 to 18 in 443565a
So I ran this test. And indeed the "received.json" was on the left-hand side. If you agree that this change is all right I will prepare a PR in the DiffEngine. |
discussing on diffengine repo so will close this |
this can now be controlled using an environment variable https://github.com/VerifyTests/DiffEngine/blob/main/docs/diff-tool.md#leftright-diff-behavior |
@SimonCropp, Environment.SetEnvironmentVariable("DiffEngine_TargetOnLeft", "true"); |
the nuget is deployed. but note that you should not add |
When files are compared by the
VisualStudioReporter
"approved.json" is displayed on the right-hand side and "reveived.json" is displayed on the left-hand side. For it this order is a very misleading because in git a new file (i.e. "reveicied.json") is shown on the right-hand side.So the current implementation of ApprovalTests makes me think that "approved.json" is the latest received file. Please consider this image.
When I look at this image I think that the latest file has a new field "Version". HOWEVER, actually the situation is the opposite. The field "Version" has been removed in the latest file. That's why I consider this implementation very confusing.
Apparently this method needs to be overridden in
VisualStudioReporter.cs
. If you agree that it could be a good improvement I could also try to prepare a PR for it.ApprovalTests.Net/src/ApprovalTests/Reporters/DiffToolReporter.cs
Lines 15 to 18 in 443565a
The text was updated successfully, but these errors were encountered: