# Selfie: a new kind of snapshot testing library for Kotlin Multiplatform

**URL:** <https://discuss.kotlinlang.org/t/selfie-a-new-kind-of-snapshot-testing-library-for-kotlin-multiplatform/27981>\
**Category:** Libraries\
**Created:** [January 19, 2024, 8:14pm UTC](https://discuss.kotlinlang.org/t/selfie-a-new-kind-of-snapshot-testing-library-for-kotlin-multiplatform/27981 "2024-01-19T20:14:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nedtwigg](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/nedtwigg/32/8680_2.png) [@nedtwigg](https://discuss.kotlinlang.org/u/nedtwigg)\
**Post date:** [January 19, 2024, 8:14pm UTC](https://discuss.kotlinlang.org/t/selfie-a-new-kind-of-snapshot-testing-library-for-kotlin-multiplatform/27981/1 "2024-01-19T20:14:18Z")

</div>

Snapshot testing has been badly underused for three reasons:

- controlling read vs write used to be cumbersome (fixed by [control comments](https://selfie.dev/jvm/get-started#quickstart))
- stale snapshots used to pile up (fixed by [garbage collection](https://github.com/diffplug/selfie/blob/main/selfie-runner-junit5/src/main/kotlin/com/diffplug/selfie/junit5/SelfieGC.kt))
- a great test should tell a story, and disk snapshots can’t do that (kinda complicated, but we [fixed that too](https://selfie.dev/jvm/advanced#harmonizing-disk-and-inline-literals))

Some friends and I just released `1.0` of a snapshot testing library called selfie (URL [selfie.dev](https://selfie.dev)) written mostly in Kotlin Multiplatform, along with some jvm-only code for JUnit 4 & 5. I’ve been using it in production and it’s been a huge upgrade for us.

No one on our team has much experience with Kotlin multiplatform, we would love help getting it running with [mocha and karma](https://github.com/diffplug/selfie/issues/84). Might be interesting to get it [running with Kotlin/Native too](https://github.com/diffplug/selfie/issues/85).

---

<div class="post-metadata">

**Author:** ![bahaabauomyus](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bahaabauomyus](https://discuss.kotlinlang.org/u/bahaabauomyus)\
**Post date:** [January 20, 2024, 6:20am UTC](https://discuss.kotlinlang.org/t/selfie-a-new-kind-of-snapshot-testing-library-for-kotlin-multiplatform/27981/2 "2024-01-20T06:20:00Z")

</div>

It is a nice library 🙂 I hope some one help you.
