Releases: approvals/ApprovalTests.Java
Improvements for IntelliJ reporters when using Jetbrains Toolbox
On Mac, when using Jetbrains Toolbox, we now should detect your IntelliJ installation and launch the idea diff viewer.
Fixes to KDiff3
Added KDiff3 Linux reporter.
Minor breaking changes
KDiff3Reporter has been moved to KDiff3MacReporter, KDiff3WindowsReporter as appropriate.
We also created a generic KDiff3 reporter that will work on all three systems.
Closes issue #412
Removal of EnvironmentAwareReporter
This is a breaking change.
When you call Reporter.report(received, approved)
it now returns if it was successful.
This makes the java architecture more consistent with other implementations and allows us to determine when something should have worked but it didn't.
It should not affect you unless you've written a custom implementation of ApprovalFailureReporter
.
Information on why and how to upgrade can be found here.
Exceptions and Help messages on duplicate verify() calls.
ApprovalTests only wants one call to verify()
per test.
There are ways to go around this but if you call verify
where it would want the exact same file name twice, it will now throw an exception.
This will make it easier for people to not be confused as most other testing frameworks allow you to put multiple assertions in the same test.
Backwards compatibility
There are some situations where you want to check that two different processes produce the same result.
Calling verify
multiple times in the same test can be a way to do this.
If you want to do that, we have provided two calls:
Approvals.settings().allowMultipleVerifyCallsForThisClass()
Approvals.settings().allowMultipleVerifyCallsForThisMethod()
Fixed bugs with ArrayUtils.combine
Fixes:
- null passed as either first or second parameters
- Typing combine(child, parent) didn't work.
- ie. combine(1.0, 2, 3) will now work.
Queryable.selectRecursivelyUntil
Also, minor IntelliJReporter fixes, handling null better.
DiffMergeReporter
Added a class DiffMergeReporter
that wraps both linux and macos reporters.
NormalizeSpacesScrubber
With this scrubber you can avoid test failures in the case that whitespace character was changed to another unicode character when displaying dates, for example https://bugs.openjdk.org/browse/JDK-8274768
This will display as
- | getTime("AM/PM") | 12:00 AM |
+ | getTime("AM/PM") | 12:00 AM |
Custom Comparator
DateScrubber.getScrubberFor()
now accepts http date header format- XStream dependency is now optional as it should be
- Options now has a comparator if you wish to create a custom comparator #301
XStream JSON Approvals
Added support for converting to JSON via XStream. This is a nice utility for handling circular references in objects.