Comments (6)
this can now be controlled using an environment variable https://github.com/VerifyTests/DiffEngine/blob/main/docs/diff-tool.md#leftright-diff-behavior
from approvaltests.net.
changing DiffRunner.Launch(diffTool, received, approved);
wont work DiffRunner.Launch
has logic in it that assumes the received and approved are passed in in the correct order.
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
from approvaltests.net.
@SimonCropp, thank you that you corrected my mistake of the design.
So as I understood VisualStudio.cs
must be changed, to be more specific this line (temp, target) => $"/diff \"{temp}\" \"{target}\"",
. So the first file is "received" and the second is "approved".
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.
So in VisualStudio.cs
I only made this change and after that the result was as I would expect ("received.json" was on the right-hand side)
If you agree that this change is all right I will prepare a PR in the DiffEngine.
from approvaltests.net.
discussing on diffengine repo so will close this
from approvaltests.net.
@SimonCropp,
thank you so much, your solution is more general and will cover similar cases in other reporters.
Tested the new version and it works as expected. Waiting for the new NuGet release
Environment.SetEnvironmentVariable("DiffEngine_TargetOnLeft", "true");
from approvaltests.net.
the nuget is deployed. but note that you should not add SetEnvironmentVariable("DiffEngine_TargetOnLeft
to your code
from approvaltests.net.
Related Issues (20)
- .NET Core 3.1 with xUnit 2.4.1 - ApprovalTests is not detecting the proper source path HOT 2
- Feature Reqest: dotnet approve all HOT 1
- Commands generated by AllFailingTestsClipboardReporter only works on Windows HOT 5
- linux usage unclear (Rider, VSCode, CLI) HOT 8
- These files have different encodings. Left file: Unicode (UTF-8) with signature. Right file: Central European (Windows). You can resolve the difference by saving the right file with the encoding Unicode (UTF-8) with signature. HOT 7
- Set project to not conflict with NCrunch HOT 2
- Upgrade DiffEngine to enable Left/Right diff behavior
- System.Exception : Could not find a diff tool for extension: .txt HOT 1
- VerifyPdfFile failed at the random generated ID HOT 7
- Looking for VS 2022 support HOT 6
- Any documentation how to use ApprovalTests with Specflow? HOT 2
- 404 Errors from dead links in help document HOT 1
- `UseApprovalSubdirectory` does not work on derived classes HOT 1
- Verifying log testing... HOT 1
- The compare appear to be in wrong order HOT 4
- DiffEngine.ProcessCleanup throws System.TypeInitializationException when running failing test HOT 1
- Update to DiffEngine 11
- drop net461 support
- NUNIT TestCase doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from approvaltests.net.