{"id":15322151,"url":"https://github.com/edmartt/go-testing-mocks","last_synced_at":"2025-03-27T18:16:21.991Z","repository":{"id":103354574,"uuid":"497373509","full_name":"Edmartt/go-testing-mocks","owner":"Edmartt","description":"This project is for learning about mocking external services calls","archived":false,"fork":false,"pushed_at":"2022-05-28T17:11:47.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T21:14:02.120Z","etag":null,"topics":["go","golang","mock","mocking","solid-principles","sqlite3","unit-test","unit-testing","vertical-slice-architecture"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Edmartt.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":"2022-05-28T16:37:13.000Z","updated_at":"2022-05-30T14:13:21.000Z","dependencies_parsed_at":"2023-07-07T21:15:37.790Z","dependency_job_id":null,"html_url":"https://github.com/Edmartt/go-testing-mocks","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"8b0a3ed0a269a46234863cf327959ae42f7632a1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Fgo-testing-mocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Fgo-testing-mocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Fgo-testing-mocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Fgo-testing-mocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edmartt","download_url":"https://codeload.github.com/Edmartt/go-testing-mocks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245898334,"owners_count":20690466,"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","golang","mock","mocking","solid-principles","sqlite3","unit-test","unit-testing","vertical-slice-architecture"],"created_at":"2024-10-01T09:14:22.986Z","updated_at":"2025-03-27T18:16:21.960Z","avatar_url":"https://github.com/Edmartt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GO-TESTING-MOCKS\n\nThe main purpose of this project is understanding the importance of knowing about what to do\nwhen our services main core depends on third party services like http services, databases, etc.\n\nFor reaching our goal of testing the service layer we make use of mocks. With a mock we can replace those third parties services calls\nwith our own logic according to the data we expect from those services.\n\n\n### Running Project\n\n1.\n\n```\ngo mod download\n```\n\nor\n\n```\ngo mod tidy\n```\n\n2.\n\n```\ngo run main.go\n```\nWhen the project is running a hardcoded user will be created in a SQLite database. If we run the project again with the same\nhardcoded user we'll have an error of nil because the CreateUser function has a check in case the user already exists.\n\n\n### Running Unit Test with a Coverage file as Output\n\n```\ngo test -v --coverprofile=coverage.out ./... ./...\n```\n\n### Watching the coverage in browser\n\n```\ngo tool cover -html=coverage.out\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedmartt%2Fgo-testing-mocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedmartt%2Fgo-testing-mocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedmartt%2Fgo-testing-mocks/lists"}