DiffEngineTray sits in the Windows tray. For supported snapshot testing libraries, it monitors pending changes in snapshots, and provides a mechanism for accepting those changes. It is intended as an alternative to using the clipboard as an approval mechanism.
dotnet tool install -g DiffEngineTray
Run diffenginetray
in a console to start the app.
Moves and deletes will be grouped by the containing solution. In the above, the files exist in DiffEngine, so they are grouped under it.
"Pending Moves" will accept the changes to file3 and file4.
Clicking "file3" or "file4" will accept the changes to file3 or file4 respectively. The drop down will expose extra actions for that change.
A test can produce multiple resulting snapshots. If the accepted versions has a different number of snapshots to the current test run, then some of those snapshots need to be deleted. The delete functionality in the tray tool handles this scenario.
"Pending Deletes" will delete file1 and file2.
Clicking "file1" or "file2" will delete file1 or file2 respectively. The drop down will expose extra actions for that change.
"Accept all" will accept all pending moves and all pending deletes.
Discard will clear all currently tracked items.
Prompts for a directory, and then recursively deletes all *.verified.*
in that directory.
Runs DiffEngineTray at system startup.
By default, when a diff is opened, the temp file will be on the left and the target file will be on the right. To invert this, select "Open on left".
Control the max instances to launch setting.
Registers a system wide HotKey to discard pending:
- Deletes
- Moves
Registers a system wide HotKey to accept pending:
- Deletes
- Moves
Registers a system wide HotKey to accept pending:
- Deletes
- Moves that are currently open in a diff tool
To limit impact on system resources, the default max concurrent open tool instances is limited to 5.
Accept all open HotKey allows the current batch of open diffs to be accepted.
- ApprovalTests v5.4.0 and above
- Shouldly v4.0.0 and above
- Verify v6.10.4 and above
{
"Type":"Move",
"Temp":"theTempFilePath",
"Target":"theTargetFilePath",
"CanKill":true,
"Exe":"theExePath",
"Arguments":"TheArguments",
"ProcessId":1000
}
{
"Type":"Move",
"Temp":"theTempFilePath",
"Target":"theTargetFilePath",
"CanKill":true,
"Exe":"theExePath",
"Arguments":"TheArguments",
"ProcessId":1000
}
%UserProfile%\.dotnet\tools\.store\diffenginetray\{VERSION}\diffenginetray\{VERSION}\tools\net8.0\any\logs
For example:
C:\Users\simon\.dotnet\tools\.store\diffenginetray\9.0.0\diffenginetray\9.0.0\tools\net8.0\any\logs