{"id":34144286,"url":"https://github.com/somatech1/mocks","last_synced_at":"2026-03-11T11:03:36.329Z","repository":{"id":220717224,"uuid":"751606438","full_name":"somatech1/mocks","owner":"somatech1","description":"A package to help creating mocks for APIs to be used in unit tests","archived":false,"fork":false,"pushed_at":"2024-04-02T19:55:35.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-17T16:52:12.458Z","etag":null,"topics":["mock","testing","unit"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/somatech1.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-02-01T23:56:20.000Z","updated_at":"2024-02-09T17:51:46.000Z","dependencies_parsed_at":"2024-04-02T20:50:32.673Z","dependency_job_id":"2988be9e-cae6-46ee-b6d7-24df5e8023e7","html_url":"https://github.com/somatech1/mocks","commit_stats":null,"previous_names":["somatech1/services-mock","somatech1/mocks"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/somatech1/mocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somatech1%2Fmocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somatech1%2Fmocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somatech1%2Fmocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somatech1%2Fmocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somatech1","download_url":"https://codeload.github.com/somatech1/mocks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somatech1%2Fmocks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30379264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["mock","testing","unit"],"created_at":"2025-12-15T03:41:26.016Z","updated_at":"2026-03-11T11:03:36.325Z","avatar_url":"https://github.com/somatech1.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mock_s\n\n## About\n\nThis package provides an easier way to mock services for testing purposes. \nThe wrapper on the [mockgen](https://github.com/uber-go/mock) gives you a\nnicer syntax to write mocks.\n\n## Usage example\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"testing\"\n    \n    \"github.com/stretchr/testify/assert\"\n    \"github.com/somatech1/mocks\"\n)\n\nfunc TestFoo(t *testing.T) {\n    ctx := context.TODO()\n    a := assert.New(t)\n\n    // You can explicitly define the mock type\n    // NewMock[example_mock.MockExampleMockMockRecorder]\n    // or let the compiler infer it\n    mock := mocks.New(\n        t,\n        example_mock.NewMockExampleMock,\n    )\n\n    expectedInput := \"Hello World\"\n    expectedOutput := \"Mocked Output\"\n\n    mock.Mock(\u0026mocks.MockOptions{\n        Ctx:    ctx,\n        Call:   mock.Recorder().GetByString,\n        Times:  1,\n        Input:  expectedInput,\n        Return: expectedOutput,\n    })\n\n    c := mock.Client()\n    output, err := c.GetByString(ctx, expectedInput)\n\n    a.NoError(err)\n    a.Equal(output, expectedOutput)\n}\n```\nSee more [examples](service_mock_test.go)\n\n## License\n\n[Mozilla Public License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomatech1%2Fmocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomatech1%2Fmocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomatech1%2Fmocks/lists"}