{"id":15284725,"url":"https://github.com/diffplug/selfie","last_synced_at":"2025-09-06T05:43:03.294Z","repository":{"id":213962863,"uuid":"616728028","full_name":"diffplug/selfie","owner":"diffplug","description":"Snapshot testing for Java, Kotlin, and the JVM","archived":false,"fork":false,"pushed_at":"2024-05-01T20:45:18.000Z","size":8106,"stargazers_count":35,"open_issues_count":38,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T20:50:16.862Z","etag":null,"topics":["groovy","java","jvm","kotlin","scala","snapshot","snapshot-testing","snapshot-tests"],"latest_commit_sha":null,"homepage":"https://selfie.dev","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diffplug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-21T00:41:59.000Z","updated_at":"2024-05-03T22:46:06.934Z","dependencies_parsed_at":"2023-12-24T19:38:02.935Z","dependency_job_id":"7a66d00e-a66c-414d-a960-7422872bf018","html_url":"https://github.com/diffplug/selfie","commit_stats":null,"previous_names":["diffplug/selfie"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffplug%2Fselfie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffplug%2Fselfie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffplug%2Fselfie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffplug%2Fselfie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diffplug","download_url":"https://codeload.github.com/diffplug/selfie/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248326396,"owners_count":21085097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["groovy","java","jvm","kotlin","scala","snapshot","snapshot-testing","snapshot-tests"],"created_at":"2024-09-30T14:59:41.927Z","updated_at":"2025-04-11T01:37:32.592Z","avatar_url":"https://github.com/diffplug.png","language":"Kotlin","readme":"# Selfie: snapshot testing and memoizing for Python, JVM, and [(your PR here)](https://github.com/diffplug/selfie/issues/85)\n\n![gif demo of selfie in action](https://docs.diffplug.com/selfie/selfie-demo.gif)\n\n## Key features\n\n- Just add a test dependency ([py](https://selfie.dev/py/get-started#installation), [jvm](https://selfie.dev/jvm/get-started#installation)), zero setup, zero config.\n- Snapshots can be [inline literals](https://selfie.dev/py#literal) or [on disk](https://selfie.dev/py#like-a-filesystem).\n- Use `expect_selfie` for testing or `cache_selfie` for [memoizing expensive API calls](https://selfie.dev/py/cache).\n- Disk snapshots are automatically [garbage collected](https://github.com/diffplug/selfie/blob/main/jvm/selfie-runner-junit5/src/main/kotlin/com/diffplug/selfie/junit5/SelfieGC.kt) when the test class or test method is removed.\n- Snapshots are **just strings**. Use html, json, markdown, whatever. No [magic serializers](https://selfie.dev/py/cache#roundtripping-typed-data).\n- Record **multiple facets** of the entity under test, e.g. for a web request...\n  - store the HTML as one facet\n  - store HTML-rendered-to-markdown as another facet\n  - store cookies in another facet\n  - **assert some facets on disk, others inline**\n  - see gif above for live demo, detailed example [here](https://selfie.dev/py/facets#harmonizing-disk-and-inline-literals)\n\nPython and JVM ports are both production-ready, other platforms on the way: [js](https://github.com/diffplug/selfie/issues/84), [.NET, go, ...](https://github.com/diffplug/selfie/issues/85)\n\n## Documentation\n\n- Quickstart **([py](https://selfie.dev/py/get-started#quickstart), [jvm](https://selfie.dev/jvm/get-started#quickstart))**\n- Facets **([py](https://selfie.dev/py/facets), [jvm](https://selfie.dev/jvm/facets))**\n- Caching / memoizing **([py](https://selfie.dev/py/cache), [jvm](https://selfie.dev/jvm/cache))**\n- Why selfie **([py](https://selfie.dev/py), [jvm](https://selfie.dev/jvm))**\n- API reference **([py](https://pydoc.selfie.dev/namespacemembers_func), [jvm](https://kdoc.selfie.dev/))**\n\n## Contributing\n\nPRs welcome! Horror stories and glory stories too, share your experience! See [`CONTRIBUTING.md`](CONTRIBUTING.md).\n\n\n## Acknowledgements\n\nHeavily inspired by [origin-energy's java-snapshot-testing](https://github.com/origin-energy/java-snapshot-testing), which in turn is heavily inspired by [Facebook's jest-snapshot](https://jestjs.io/docs/snapshot-testing).\n","funding_links":[],"categories":["Projects","项目","测试"],"sub_categories":["Testing","测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiffplug%2Fselfie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiffplug%2Fselfie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiffplug%2Fselfie/lists"}