skuzzle / snapshot-tests

Convenient snapshot testing for Java
https://skuzzle.github.io/snapshot-tests/reference/latest/
MIT License
12 stars 0 forks source link

Make all SnapshotTestOptions configurable via DSL #94

Open skuzzle opened 1 year ago

skuzzle commented 1 year ago

We should enhance the DSL so that all the options that can be configured via @SnapshotTestOptions can also be configured via the DSL like

@Test
void someTest(Snapshot snapshot) {
    snapshot.withOptions(options -> options
        .withtextDiffContextLines(10)
        .withalwaysPersistActualResult(true))
    ...
}

This solution is kind of in conflict with the current SnapshotConfiguration class approach which serves partly the same use case but isn't configurable from public API.

Solving this might require deeper refactorings in the core module