- Introduction
- Disposable Objects
- Namers - how Approved Files are named
- Writers - how things being verified are written to file
- Comparators - how files are compared
- Reporters - how test failures are shown
This page provides a starting point to see all the ways of controlling the behaviour of Approval Tests.
See Disposable Objects for a general overview of how most customisation of Approval Tests works.
See Using sub-directories for approved files for putting Approval files in a sub-directory, to keep your tests directory tidy.
See SeparateApprovedAndReceivedDirectoriesNamer to put the Approved and Received files in adjacent directories, in order to allow a folder-diffing tool to compare the two directories.
See Namers for controlling how Approval files are named.
See Multiple output files per test for multiple ways to control file names when verifying more than one output file in a test.
See Using Approval Tests With Google Tests for how to control the names of Approval files if using that framework.
Filename Extensions: Although it seems like the file extension would be created by the namer, it is actually created by the writer. See below.
See Writers for how to customize the serialization of objects.
Filename Extensions: If you only want to change a file extension, you might want to consider using the convenience functions Approvals::verifyWithExtension
: see Using custom filename extensions
See Custom Comparators for controlling how Approval Tests determines if the Received File and Approved File are equivalent.
See Reporters to control how test failures are shown. This is typically done by showing a diff tool.