java-snapshot-testing
java-snapshot-testing copied to clipboard
Facebook style snapshot testing for JAVA Tests
When using nested tests, `Expect` is not injected into the outer class. Example ```kt @ExtendWith(SnapshotExtension::class) class ExampleTest { lateinit var expect: Expect @Test fun foo() { expect.toMatchSnapshot("foo") } @Nested inner...
Is it possible to throw the error from a reporter directly in case there is only one compatible reporter instead of catching it and wrap it into the custom SnapshotMatchException?...
When running with `@Execution(ExecutionMode.CONCURRENT)` on class level and `@Nested` test classes, it seems that all tests are named after the first nested test class that is run and then all...
### Discussed in https://github.com/origin-energy/java-snapshot-testing/discussions/129 Originally posted by **nedtwigg** December 11, 2022 I think it's important for plaintext snapshots to have perfect roundtrips. That means that it's okay if the *encoded*...
I have used snapshots for a while with jest and I'm really glad this library exists for Java. Snapshot-based assertions are very useful to make sure a data-processing system is...
In order to help make tests more deterministic - add REGEX masking capability ie. to mask dates in your output, you might supply the following ```java expect.mask("\\d{2}-\\d{2}-\d{4}", "**-**-****").toMatchSnapshot(obj) ``` You...
### Discussed in https://github.com/origin-energy/java-snapshot-testing/discussions/134 Originally posted by **nedtwigg** December 12, 2022 I've got this in my `build.gradle`, works great... ``` test { if (System.env['CI'] == null) { systemProperty "updateSnapshot", ""...
Looking at `java-snapshot-testing-junit5-4.0.8.jar` for example, it seems that all shadowJar classes (https://github.com/origin-energy/java-snapshot-testing/blob/master/build.gradle#L25-L26) are duplicated:  On the one hand this probably blows up the size of the JAR, on the...
If a test has multiple scenarios, we currently throw an exception the first time we call `toMatchSnapshot()` with different data. But then we miss the opportunity to update the rest...