{"id":16586595,"url":"https://github.com/oberblastmeister/hspec-snap","last_synced_at":"2026-06-08T05:31:11.011Z","repository":{"id":124073663,"uuid":"383243631","full_name":"oberblastmeister/hspec-snap","owner":"oberblastmeister","description":"Snapshot testing for hspec","archived":false,"fork":false,"pushed_at":"2021-07-05T19:44:53.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T08:15:17.062Z","etag":null,"topics":["cli","haskell","hspec","testing"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oberblastmeister.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2021-07-05T19:20:59.000Z","updated_at":"2021-07-05T19:45:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"2633f145-27a9-4b7c-bc39-f47c6e6a03e2","html_url":"https://github.com/oberblastmeister/hspec-snap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oberblastmeister/hspec-snap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oberblastmeister%2Fhspec-snap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oberblastmeister%2Fhspec-snap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oberblastmeister%2Fhspec-snap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oberblastmeister%2Fhspec-snap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oberblastmeister","download_url":"https://codeload.github.com/oberblastmeister/hspec-snap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oberblastmeister%2Fhspec-snap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34050225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","haskell","hspec","testing"],"created_at":"2024-10-11T22:52:01.089Z","updated_at":"2026-06-08T05:31:10.960Z","avatar_url":"https://github.com/oberblastmeister.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hspec-snap\n\n**note**: this is still alpha quality software!\n\nSnapshot tests assert values against a reference (the snapshot). This is useful when your reference values are very large or change often. Snapshot tests are also called golden tests or approval tests.\n\n## Quick Start\n\nYou can write you hspec tests as normal but use `snap` instead of `it` when you want to use a snapshot test.\n\n```haskell\nimport Test.Hspec\nimport Test.Hspec.Snap\n\ndescribe \"a description\"\n  snap \"snapshot_test\" $\n    show [1, 2, 3]\n\n  it \"should work\" $\n    1 `shouldBe` 1\n```\n\nAfter the test has been run for the first time, a snapshot file will be created. If the test changes, for example changing it to\n\n```haskell\nsnap \"snapshot_test\" $\n  show [1, 2]\n```\n\nthe test will fail and a file called `snapshot_test.snap.new` will be created with the contents `[1, 2]`. You can then use the cli to decide what to do with the new file.\n\nYou can run\n```sh\n$ hsnap review\n```\nto get an interactive interface to accept, reject, or skip the new snapshot file.\n\n## CLI Options\n\n```\nUsage: hsnap COMMAND\n  a wrapper to run snapshot tests\n\nAvailable options:\n  -h,--help                Show this help text\n\nAvailable commands:\n  test                     Run all the tests and then review\n  diff                     Show all the snapshot diffs\n  review                   Interactively review all snapshots\n  accept                   Accept all snapshots\n  reject                   Reject all snapshots\n```\n\n## Inspiration\n\nThis library was inspired by [insta](https://github.com/mitsuhiko/insta) and\n[hspec-golden](https://github.com/stackbuilders/hspec-golden)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foberblastmeister%2Fhspec-snap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foberblastmeister%2Fhspec-snap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foberblastmeister%2Fhspec-snap/lists"}