Changelog

May 26, 2026 · View on GitHub

Changelog for the selfie JVM libraries.

[Unreleased]

[3.1.1] - 2026-05-26

Fixed

  • ArrayMap no longer throws NumberFormatException for test case names containing very large numbers. (#577)

[3.1.0] - 2026-05-09

Added

  • SelfieSettingsAPI now has overridable testAnnotations and testSuperclasses properties which allow users with custom composed annotations or Spec-like base classes to register them. (#573)

[3.0.0] - 2026-03-02

Changed

  • BREAKING Bumped Kotest from 5.x to 6.x. If you need Kotest 5.x compatibility, stick with 2.5.5. (#559)
    • This breaking change only affects Kotest users.
    • As part of the Kotest 6.x migration, your AbstractProjectConfig must either have the fully qualified name of io.kotest.provided.ProjectConfig or the system property kotest.framework.config.fqn must be set. See Kotest docs for more info.
    • The breaking changes are only within selfie-runner-kotest. So if you are stuck on Kotest 5.x but want some feature or bugfix only available in a 3.x version of Selfie, you can probably get it by grabbing the latest Selfie but using 2.5.5 for the selfie-runner-kotest artifact. But in the long-term, we recommend using the latest supported version of all dependencies.

[2.5.5] - 2025-11-22

Fixed

  • SnapshotFileLayout now computes root folder lazily. (#557 partial fix for #551)
    • Allows parallel Maven execution with surefire and failsafe plugins with forkCount greater than one, but it only works if reuseForks set to false.

[2.5.4] - 2025-09-12

Fixed

  • Unsupported test sources (such as FieldSource) no longer cause the JUnit5 runner to crash. (#550 fixes #549)

Changed

  • Bump minimum required Kotest from 5.4.0 to 5.6.0 (#535)
    • required to fix java.lang.NoSuchMethodError: 'long kotlin.time.Duration$Companion.milliseconds-UwyO8pc(long)'

[2.5.3] - 2025-05-21

Fixed

  • Restore support for JRE 11. (fixes #528)
  • snapshots created by junit.jupiter.api.TestFactory are no longer garbage-collected (#534)
  • support parallel testing under junit.jupiter.execution.parallel.enabled=true (#534)

[2.5.2] - 2025-04-28

Fixed

  • Off-by-one in the error message for a VCR key mismatch. (#526)
  • Fix StringIndexOutOfBoundsException when an empty snapshot had a facet added. (fixes #529)
  • Fix ClassCastException when multiple nested test cases need to update snapshot. (fixes #531)

[2.5.1] - 2025-03-04

Fixed

  • Selfie VCR is now out of beta, no opt-in required. (#525)
    • ArrayMap now sorts strings with multi-digit numbers as 1 2 ... 9 10 11 instead of 1 11 2 ....
    • Improved VCR-specific error messages for determining why //selfieonce might not be working for a test rule.
    • Fixed some bugs in VCR data storage (specifically concurrency and multiple frames).

[2.5.0] - 2025-02-21

Added

  • Added an entrypoint Selfie.vcrTestLocator() for the new VcrSelfie class for snapshotting and replaying network traffic. (#517)

Fixed

  • Fixed a bug when saving facets containing keys with the ] character (#518)

[2.4.2] - 2025-01-01

Fixed

  • A single leading space (such as in the copyright header) should not override an otherwise 100% tab-indented file. (#506)

[2.4.1] - 2024-10-07

Fixed

  • Multiline toBe assertions (introduced in 2.1.0 for Java pre-15) were not throwing exceptions on snapshot mismatch, now fixed. (#479)

[2.4.0] - 2024-10-01

Added

  • Snapshot mismatch error messages now show a diff of the first mismatched line. (#477)
    • before
      Snapshot mismatch
      - update this snapshot by adding `_TODO` to the function name
      - update all snapshots in this file by adding `//selfieonce` or `//SELFIEWRITE`
      
    • after
      Snapshot mismatch at L7:C9
      -Testing 123
      +Testing ABC
      ‣ update this snapshot by adding `_TODO` to the function name
      ‣ update all snapshots in this file by adding `//selfieonce` or `//SELFIEWRITE`
      

[2.3.0] - 2024-07-11

Added

  • DiskSelfie now makes the Snapshot actual value public, so that other testing infrastructure can read from snapshotted values. (#467)

Fixed

  • cacheSelfie was missing @JvmOverloads on the methods with default arguments. (#425)

[2.2.1] - 2024-06-05

Fixed

  • Added Selfie.expectSelfies(Iterable<T> items, Function<T, String> toString) for doing easy "multi-asserts" in suspend fun also. (#421)

[2.2.0] - 2024-06-04

Added

  • SelfieSettingsAPI now has a field javaDontUseTripleQuoteLiterals which ensures that multiline strings are always encoded as " strings. (#417)

[2.1.0] - 2024-06-03

Added

  • Added Selfie.expectSelfies(Iterable<T> items, Function<T, String> toString) for doing easy "multi-asserts". (#416)
  • For java versions which don't support multiline string literals, we now encode multiline strings like so: (#406)
    • toBe("line1",
           "line2",
           "line3");
      

Changed

  • Bump Kotlin to 2.0.0. (#405)

Fixed

  • Do not remove stale snapshot files when readonly is true. (#367)
  • Provide more debugging info when a snapshot gets set multiple times. (helps with #370)

[2.0.2] - 2024-03-20

Fixed

  • toBeFile now checks for duplicate writes and throws a more helpful error message if the file doesn't exist. (#277)

[2.0.1] - 2024-02-24

Fixed

  • The coroutines methods used to eagerly throw an exception if they were ever called from anywhere besides a Kotest method. Now they wait until toMatchDisk() is called, because they can work just fine anywhere if you use toBe. (#247)

[2.0.0] - 2024-02-21

Added

  • Memoization (#219 implements #215)
    • like expectSelfie, all are available as Selfie.cacheSelfie or as suspend fun in com.diffplug.selfie.coroutines.
val cachedResult: ByteArray = Selfie.cacheSelfieBinary { dalleJpeg() }.toBeFile("example.jpg")
val cachedResult: String    = Selfie.cacheSelfie { someString() }.toBe("what it was earlier")
val cachedResult: T         = Selfie.cacheSelfieJson { anyKotlinxSerializable() }.toBe("""{"key": "value"}""")
val cachedResult: T         = Selfie.cacheSelfieBinarySerializable { anyJavaIoSerializable() }.toMatchDisk()
  • toBeBase64 and toBeFile for true binary comparison of binary snapshots and facets. (#224)
  • spaces in multiline string literals aren't always escaped. (#220)
    • if the leading spaces in the string literal match the file's existing indentation

Changed

  • BREAKING reordered a class hierarchy for better binary support. (#221)
    • most users won't need to make any changes at all
    • only exception is that expectSelfie(byte[]).toBe is now a compile error, must do toBeBase64

[1.2.0] - 2024-02-12

Added

  • Kotest support.
    • Add SelfieExtension to your AbstractProjectConfig.
    • Instead of calling Selfie.expectSelfie, call com.diffplug.selfie.coroutines.expectSelfie.
    • selfie-runner-junit5 supports snapshots in regular JUnit tests and Kotest tests in the same project.
    • selfie-runner-kotest is a new selfie implemented in Kotlin Multiplatform, but doesn't support snapshots within regular JUnit tests.
    • Full docs at https://selfie.dev/jvm/kotest.

Fixed

  • Swap thread-local cache for thread-ignorant LRU to improve performance when used with coroutines. (#191)

Changes

  • (no user-facing changes) replaced terrible platform-specific Path with TypedPath. (#184)
  • (no user-facing changes) replaced SnapshotStorage with SnapshotSystem + DiskStorage. (#198)
  • (no user-facing changes) replaced most synchronized with CAS. (#199)

[1.1.2] - 2024-01-30

Fixed

  • @ParameterizedTest no longer has. (#140)
  • If a test class contained package-private methods and a single test method was run without the others, selfie would erroneously garbage collect disk snapshots for the other methods, now fixed. (#175 fixes #174)

[1.1.1] - 2024-01-25

Fixed

  • Selfie was erroneously garbage collecting snapshots when a test class contained no @Test public methods. (#124 fixes #123)

[1.1.0] - 2024-01-21

Added

  • Support for @ParameterizedTest. (#118)
  • ArraySet<K> has been added to the standard library alongside ArrayMap<K, V>. (#119)
    • These have the strange property that if the key is String, then / characters are sorted to be the lowest possible character.

Fixed

  • We already smuggle errors from initialization to help debug them, and now we also smuggle errors that happen during test execution. (#117)
  • Fix a garbage collection bug which occurred when a test method's name was a prefix of another test method's name. (#119)

[1.0.1] - 2024-01-19

Fixed

  • Fix CompoundLens for Java users.

[1.0.0] - 2024-01-18

Added

  • Full support for binary snapshots. (#108)

Fixed

  • Groovy multiline string values just go into " strings instead of """ until we have a chance to implement them properly. (#107)

[0.3.0] - 2024-01-17

Added

  • toBe("mismatched") now gets rewritten in write mode
  • fully implemented the new control scheme (#74)
  • integers get _ separators for thousands, millions, etc

Known broken

  • Groovy multiline strings
  • Binary

[0.2.0] - 2023-12-27

Added

  • DiskSelfie.toMatchDisk now returns DiskSelfie so that we can fluently chain inline assertions on facets.

[0.1.3] - 2023-12-26

  • Publish selfie-lib-jvm and selfie-lib to Maven Central.

[0.1.2] - 2023-12-26

  • Publish selfie-lib-jvm instead of just selfie-lib to Maven Central.

[0.1.1] - 2023-12-24

  • Initial release, take 2.

[0.1.0] - 2023-12-24

  • Initial release.