{"id":17091051,"url":"https://github.com/wldcordeiro/snapshot-diff-serializer","last_synced_at":"2026-04-19T04:33:01.859Z","repository":{"id":57364639,"uuid":"131879225","full_name":"wldcordeiro/snapshot-diff-serializer","owner":"wldcordeiro","description":"A serializer that lets you generate snapshot diffs between two values","archived":false,"fork":false,"pushed_at":"2018-05-02T17:28:23.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-20T13:45:42.593Z","etag":null,"topics":["javascript","jest","snapshot-testing","snapshots","testing"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/wldcordeiro.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}},"created_at":"2018-05-02T16:42:07.000Z","updated_at":"2018-05-16T21:59:04.000Z","dependencies_parsed_at":"2022-09-13T21:11:29.230Z","dependency_job_id":null,"html_url":"https://github.com/wldcordeiro/snapshot-diff-serializer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wldcordeiro/snapshot-diff-serializer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wldcordeiro%2Fsnapshot-diff-serializer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wldcordeiro%2Fsnapshot-diff-serializer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wldcordeiro%2Fsnapshot-diff-serializer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wldcordeiro%2Fsnapshot-diff-serializer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wldcordeiro","download_url":"https://codeload.github.com/wldcordeiro/snapshot-diff-serializer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wldcordeiro%2Fsnapshot-diff-serializer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31994999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["javascript","jest","snapshot-testing","snapshots","testing"],"created_at":"2024-10-14T13:57:26.470Z","updated_at":"2026-04-19T04:33:01.804Z","avatar_url":"https://github.com/wldcordeiro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snapshot Diff Serializer\n\nThis is a simple diffing utility for Jest that is inspired by [snapshot-diff](https://github.com/jest-community/snapshot-diff). The key difference here is that `snapshot-diff-serializer` only comes as a serializer and is agnostic of other serializers, meaning you get nice diffs with Enzyme, or other serializers applied (something that `snapshot-diff` doesn't do).\n\n## Installation\n\n```\n# npm\nnpm install --dev snapshot-diff-serializer\n# yarn\nyarn add -D snapshot-diff-serializer\n```\n\n## Configuration\n\nAdd the serializer to your `snapshotSerializers` array in your Jest config (example using package.json)\n\n```json\n{\n  \"jest\": {\n    \"snapshotSerializers\": [\n      \"jest-glamor-react\",\n      \"enzyme-to-json/serializer\",\n      \"\u003crootDir\u003e/snapshot-diff-serializer\"\n    ],\n  },\n}\n```\n\n## Usage\n\nHere is an example of using this serializer:\n\n```jsx\nconst Component = ({ foo, bar }) =\u003e (\n  \u003cdiv\u003e\n    {foo != null \u0026\u0026 foo}\n    {bar != null \u0026\u0026 bar}\n  \u003c/div\u003e\n)\n```\n\n```jsx\nimport { shallow } from 'enzyme'\n// Test\ndescribe('Component', () =\u003e {\n  test('variants', () =\u003e {\n    expect({\n      diffA: shallow(\u003cComponent foo={3} /\u003e),\n      diffB: shallow(\u003cComponent bar={5} /\u003e),\n      }).toMatchSnapshot()\n  })\n})\n```\n\nThe produced snapshot would look like this:\n\n```\nexports[`Component variants 1`] = `\n- Diff A\n+ Diff B\n\n  \u003cdiv\u003e\n-   3\n+   5\n  \u003c/div\u003e\n`;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwldcordeiro%2Fsnapshot-diff-serializer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwldcordeiro%2Fsnapshot-diff-serializer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwldcordeiro%2Fsnapshot-diff-serializer/lists"}