Releases: approvals/ApprovalTests.Java
SimpleLogger handles threading better for tests
By default, when you call SimpleLogger.logToString()
will now create an instance of it's logger per thread. This is particular useful when running tests in Intellij.
Query.skip and Query.take
Added skip() and take() functions to Query/Queryable objects
Query.skip and Query.take
Added skip() and take() functions to Query/Queryable objects
Query.skip and Query.take
Added skip() and take() functions to Query/Queryable objects
Support for dynamic tests with new naming approach
We deprecated JupiterApprovals.dynamicTest(String displayName, Action0 action0)
and want you to instead use JupiterApprovalsdynamicTest(String displayName, Action1<Options> action1)
which passes back a prepopulated options.
Support for jqwik and other test frameworks using @Testable
Breaking Change
JUnit5Approvals
has been renamed to JupiterApprovals
.
New Feature
We now support the detection of @testable, meaning most tests that run in Junit 5 engine will be supported.
Approvals.NAMES
ExtraInformation.Approvals.txt
the old way
There is now a new way to add information to approval names. Previously the way to add additional information was
try (NamedEnvironment ne1 = NamerFactory.asOsSpecificTest()) {
try (NamedEnvironment ne2 = NamerFactory.asMachineNameSpecificTest()) {
Approvals.verify("hello, World!");
}
}
the new way
We now added a cleaner and more thread-safe method of passing in an Options
to the additional information.
Options options = Approvals.NAMES.asOsSpecificTest().and(Approvals.NAMES::asMachineNameSpecificTest);
Approvals.verify("hello, World!", options);
We're not removing the previous way, we're simply adding the new way. In the future, we will update everything underneath to be more thread-safe.
More
We're having a new reporter for TortoiseGIT. Thank you @pfichtner
JsonJacksonApprovals
You can now use jackson to render your json or continue to use Gson.
Both of these require optional dependencies on Gson/Jackson, but these dependencies are not required if you don't use JsonApprovals
or JsonJacksonApprovals
.
AwtApprovals is JRE aware
Breaking change
Why
In JRE 11 the compression algorithm for png files changed. Approvals now appends either jdkPre11
or jdkPost11
to the filenames to make this distinction clear and allow for running in CI.
Who is affected
This will only affect you if you're using AwtApprovals
.
Bugfix for AwtApprovals.verify(BufferedImage)
Fixes a bug where AwtApprovals.verify(BufferedImage)
rendered a string instead of an image.