- Using Reporters
- Making Custom Reporters
- Joining Reporters
- Auto-Approving Reporters
- Continuous Integration
For an introduction on how to use reporters check out getting started with reporters
ApprovalTests Diff Reporters use DiffEngine which supports the following diff tools
Custom Diff Tools can be added via DiffEngine. See: https://github.com/SimonCropp/Verify/blob/master/docs/diff-tool.custom.md
Extend IApprovalFailureReporter
. For example a file can be launched on failure:
namespace ApprovalTests.Reporters;
public class FileLauncherReporter : IApprovalFailureReporter
{
public static readonly FileLauncherReporter INSTANCE = new();
public void Report(string approved, string received)
{
QuietReporter.DisplayCommandLineApproval(approved, received);
Process.Start(received);
}
}
These classes help you combine reporters to make more powerful combinations
- FirstWorkingReporter - launch the first report for this system, only 1
- MultiReporter - launch ALL reporters
See How to customize the order of DiffTools in your Reporter
These reporters create a commandline move file to approve the results and place it on your clipboard when a test fails.
- ClipboardReporter - This test only
- AllFailingTestsClipboardReporter - All tests (this might make a long command line)
ApprovalTests will not launch anything if you are running on a CI machine.
Currently, we support:
TfsReporter.INSTANCE,
TfsVnextReporter.INSTANCE,
TeamCityReporter.INSTANCE,
JenkinsReporter.INSTANCE,
BambooReporter.INSTANCE,
NCrunchReporter.INSTANCE,
MyGetReporter.INSTANCE,
GoContinuousDeliveryReporter.INSTANCE,
AppVeyorReporter.INSTANCE
You can add to this by configuring the FrontLoadedReporter Annotation.