java-snapshot-testing icon indicating copy to clipboard operation
java-snapshot-testing copied to clipboard

Facebook style snapshot testing for JAVA Tests

Results 9 java-snapshot-testing issues
Sort by recently updated
recently updated
newest added

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...

enhancement

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?...

enhancement

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...

bug
help wanted

### 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*...

enhancement

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...

enhancement
help wanted

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...

help wanted

### 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", ""...

enhancement
help wanted

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: ![grafik](https://github.com/origin-energy/java-snapshot-testing/assets/78534/0398591a-8220-4b43-a35f-b96d9c09508f) 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...