Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
/ selfie-python-wip Public archive
forked from diffplug/selfie

A WIP repo where we will bring our python implementation to life

License

Notifications You must be signed in to change notification settings

diffplug/selfie-python-wip

 
 

Repository files navigation

Selfie: snapshot testing and memoizing for Java, Kotlin, and the JVM

gif demo of selfie in action

Key features

  • Just add a test dependency, zero setup, zero config.
  • Snapshots can be inline literals or on disk.
  • Use expectSelfie for testing or cacheSelfie for memoizing expensive API calls.
  • Disk snapshots are automatically garbage collected when the test class or test method is removed.
  • Snapshots are just strings. Use html, json, markdown, whatever. No magic serializers.
  • Record multiple facets of the entity under test, e.g. for a web request...
    • store the HTML as one facet
    • store HTML-rendered-to-markdown as another facet
    • store cookies in another facet
    • assert some facets on disk, others inline
    • see gif above for live demo, detailed example here

JVM only for now, python is in progress, other platforms on the way: js, .NET, go, ...

Documentation

Contributing

PRs welcome! Horror stories and glory stories too, share your experience! See CONTRIBUTING.md.

Acknowledgements

Heavily inspired by origin-energy's java-snapshot-testing, which in turn is heavily inspired by Facebook's jest-snapshot.

About

A WIP repo where we will bring our python implementation to life

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 63.2%
  • Python 13.9%
  • TypeScript 8.2%
  • MDX 7.1%
  • Java 4.3%
  • JavaScript 1.6%
  • Other 1.7%