{"id":16861934,"url":"https://github.com/maelvls/snapgo","last_synced_at":"2025-03-18T15:55:32.174Z","repository":{"id":79938171,"uuid":"226584982","full_name":"maelvls/snapgo","owner":"maelvls","description":"Jest Snapshots for Gomock proof of concept","archived":false,"fork":false,"pushed_at":"2019-12-08T08:57:33.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T19:43:59.229Z","etag":null,"topics":["go","gomock","jest-inline-snapshots"],"latest_commit_sha":null,"homepage":"","language":"Go","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/maelvls.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-12-07T22:38:52.000Z","updated_at":"2020-11-13T09:08:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"c71366eb-2f61-404f-9d27-b209b1ebf493","html_url":"https://github.com/maelvls/snapgo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelvls%2Fsnapgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelvls%2Fsnapgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelvls%2Fsnapgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelvls%2Fsnapgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maelvls","download_url":"https://codeload.github.com/maelvls/snapgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257259,"owners_count":20424127,"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":["go","gomock","jest-inline-snapshots"],"created_at":"2024-10-13T14:33:59.406Z","updated_at":"2025-03-18T15:55:32.134Z","avatar_url":"https://github.com/maelvls.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jest Inline Snapshots for Gomock\n\n**Warning**: this is just a proof-of-concept, please do not use it.\n\nI find Jest inline snapshotting great and wanted to have the same kind of\nexperience in Go. The issue in Go is that mocking requires a lot of manual\ntry-and-error when figuring out what input is expected for a mocked call.\n\nThe `snap.InlineSnapshot` can be used in gomock's `EXPECT`. Imagine you\nhave a deeply nested struct:\n\n```go\nmock.EXPECT().\n    SomeFunction(snap.InlineSnapshot(deeplyNestedStruct))\n```\n\nRunning with `.Update()` will update the snapshots and the\ndeeplyNestedStruct will get filled with the 'got' value:\n\n```go\nsnap.InlineSnapshot(nil).Update().Matches(\u0026struct{data string}{\"foo\"})\n```\n\nwill become\n\n```go\nsnap.InlineSnapshot(\u0026struct{data string}{\"foo\"}).Matches(\u0026struct{data string}{\"foo\"})\n```\n\n(remember to remove `Update()`)\n\n## Caveats\n\n- all the fields, even the nil ones, are shown\n- problems with `*string` (and any pointer to constant literals)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaelvls%2Fsnapgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaelvls%2Fsnapgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaelvls%2Fsnapgo/lists"}