Releases: approvals/ApprovalTests.Java
Queryable.firstOrThrow
Creates local log of touched approved files
Note: you need to add the following to your .gitignore
.approval_tests_temp/
ApprovalTests now create a temp log in .approval_tests_temp/.approved_files.log
after each run that stores all the .approved.
files that were touched.
This enables other tooling to do things such as find abandoned files.
Also, we added :
FileUtils.appendToFile(file, txt)
XmlXomApprovals
Xom has support for emojies, so it can be a confinient way to use for xml that contains emojies.
var expected = """
<?xml version="1.0" encoding="UTF-8"?>
<a>
<b>😸 & 🐶</b>
</a>
""";
String minimizedXml = expected.replaceAll("\n", " ").replace(" ", "");
XmlXomApprovals.verifyXml(minimizedXml, new Options().inline(expected));
We also allow you to create your own pretty printer when using Approvals.verify
.
Or no pretty printing at all, then use
Approvals.verifyXml(xml, x -> x);
AraxisMergeReporter and better Jackson support
Minor fixes
Saver2 utilities
Convinience functions for creating Savers that take 2 parameters:
Saver<Tuple<Customer, String>> mailSaver = Saver2.create(mailServer::sendMessage);
We also believe we made approvlatests again compatible with JDK 8.
Support for setting reporter in environment variables
Minor Improvements to JsonApprovals
InlineOptions.semiAutomaticWithPreviousApproved()
24.2.0 a reformat code
Options.addReporter(reporter)
You can call addReporter(reporter)
on Options
and it will open both/all reporters on test failure.