{"id":16458082,"url":"https://github.com/dczajkowski/snapshy","last_synced_at":"2025-08-01T23:31:14.165Z","repository":{"id":34868640,"uuid":"184844185","full_name":"DCzajkowski/snapshy","owner":"DCzajkowski","description":"📸 A package for running snapshot tests in Elixir","archived":false,"fork":false,"pushed_at":"2023-09-15T03:28:38.000Z","size":50,"stargazers_count":19,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-01T08:23:08.434Z","etag":null,"topics":["elixir","elixir-lang","elixir-language","package","snapshot-testing","testing"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/snapshy","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DCzajkowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-05-04T02:38:20.000Z","updated_at":"2024-11-27T20:03:40.000Z","dependencies_parsed_at":"2024-06-11T17:10:05.039Z","dependency_job_id":"dcfbc25b-c3f8-4946-a3f6-a995efc1dd97","html_url":"https://github.com/DCzajkowski/snapshy","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fsnapshy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fsnapshy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fsnapshy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fsnapshy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCzajkowski","download_url":"https://codeload.github.com/DCzajkowski/snapshy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228413997,"owners_count":17915921,"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":["elixir","elixir-lang","elixir-language","package","snapshot-testing","testing"],"created_at":"2024-10-11T10:44:11.532Z","updated_at":"2024-12-06T05:11:29.250Z","avatar_url":"https://github.com/DCzajkowski.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snapshy\n\nSnapshy is an Elixir package for running snapshot tests in ExUnit.\n\n## Alternatives\n\nWhen I was creating Snapshy I didn't know of any package that would support snapshot testing in Elixir. Since, I have found @assert-value's [assert_value_elixir](https://github.com/assert-value/assert_value_elixir), which is more feature-rich and more polished. If you need something very light-weight, Snapshy might be a good choice. However, if you want interactivity and more features, give [assert_value_elixir](https://hex.pm/packages/assert_value) a try :)\n\n## Installation\n\nAdd `snapshy` to your list of dependencies in `mix.exs` and run `mix deps.get`:\n\n```elixir\ndef deps do\n  [\n    # ...\n    {:snapshy, \"~\u003e 0.2\"}\n  ]\nend\n```\n\n## Overview\n\nThe way this works:\n\n1. Add Snapshy to the test\n\n```diff\n defmodule TokenizerTest do\n+  use Snapshy\n   use ExUnit.Case\n\n   # ...\n end\n```\n\n2. Replace `test` with `test_snapshot`\n\n```diff\n-  test \"correctly tokenizes booleans\" do\n+  test_snapshot \"correctly tokenizes booleans\" do\n     # ...\n   end\n```\n\n3. Replace an assertion with simple function call\n\n```diff\n-    assert(\n-      tokens(\"true false\") == [\n-        boolean: \"true\",\n-        boolean: \"false\"\n-      ]\n-    )\n+    tokens(\"true false\")\n```\n\nThe first time a snapshot will be created in `test/__snapshots__/path/to/test_file/function_name.stub`. The second time, an assertion will be made against the snapshot. If you make changes and you want to update snapshots, run `SNAPSHY_OVERRIDE=true mix test` instead of `mix test`. Verify in git every change is correct.\n\nAlternatively, you can use a macro call instead of the `test_snapshot` macro like so:\n```elixir\ntest \"correctly tokenizes booleans\" do\n  match_snapshot tokens(\"true false\")\nend\n```\n**Careful!** There can only be one `match_snapshot` call per test macro call.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdczajkowski%2Fsnapshy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdczajkowski%2Fsnapshy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdczajkowski%2Fsnapshy/lists"}