GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - diffplug/selfie-lib: Snapshot testing for Java, Kotlin, and the JVM

BranchesTags
Open more actions menu

Latest commit

 

History

2,510 Commits
2,510 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
jvm
jvm
 
 
python
python
 
 
selfie.dev
selfie.dev
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
renovate.json
renovate.json
 
 

Repository files navigation

selfie-lib: snapshot testing for Python and JVM

Moved: this library now lives at diffplug/selfie-lib, with docs at lib.selfie.dev. Maven and PyPI coordinates and the API are unchanged, so you don't need to change anything. Read the announcement.

gif demo of selfie in action

Key features

  • Just add a test dependency (py, jvm), zero setup, zero config.
  • Snapshots can be inline literals or on disk.
  • Use expect_selfie for testing or cache_selfie 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

Python and JVM ports are both production-ready.

Documentation

  • Quickstart (py, jvm)
  • Facets (py, jvm)
  • Caching / memoizing (py, jvm)
  • Why selfie (py, jvm)
  • API reference (py, jvm)

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

Snapshot testing for Java, Kotlin, and the JVM

lib.selfie.dev

Topics

groovyjavajvmkotlinscalasnapshotsnapshot-testingsnapshot-tests

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

103 stars

Watchers

2 watching

Forks

18 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.