Releases: approvals/ApprovalTests.Java
Releases · approvals/ApprovalTests.Java
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.
InlineOptions
BREAKING CHANGE
verify(result, options=Options().inline(expected, showCode=false))
verify(result, options=Options().inline(expected, showCode=true))
is now
verify(result, options=Options().inline(expected, InlineOptions.showCode(false)))
verify(result, options=Options().inline(expected))
New Features
You can now do InlineOptions.automatic()
and InlineOptions.semiAutomatic()
.
ParseInput with 3 parameters
Added ParseInput with 3 parameters and allows arrays as last argument for ParseInput with 2 and 3 Parameters. To understand this you might want to have a look at the python documentation.