{"id":18672125,"url":"https://github.com/dfirebaugh/httptester","last_synced_at":"2025-07-31T10:14:26.161Z","repository":{"id":79213349,"uuid":"600774947","full_name":"dfirebaugh/httptester","owner":"dfirebaugh","description":"a library for building simple httptests","archived":false,"fork":false,"pushed_at":"2023-02-12T15:20:30.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T03:13:40.899Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfirebaugh.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":"2023-02-12T15:07:53.000Z","updated_at":"2023-02-12T15:10:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"790ea9a4-da4e-4fa2-a9c4-a155b4104baf","html_url":"https://github.com/dfirebaugh/httptester","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dfirebaugh/httptester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhttptester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhttptester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhttptester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhttptester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfirebaugh","download_url":"https://codeload.github.com/dfirebaugh/httptester/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhttptester/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268022594,"owners_count":24182901,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"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":[],"created_at":"2024-11-07T09:09:33.719Z","updated_at":"2025-07-31T10:14:26.115Z","avatar_url":"https://github.com/dfirebaugh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httptester\n\n`httptester` provides a format for running related tests in a loop. This encourages negative testing and can help facilitate better coverage.\n\n## Add to your project\n```bash\ngo get github.com/dfirebaugh/httptester\n```\n\n## Example\n\n```go\n\nfunc TestGetEntity(t *testing.T) {\n\tcomicRepo := in_memory.Repo[entity.Comic]{}\n\tcomicService := service.New[entity.Comic](\u0026comicRepo)\n\tcomicHandler := v1.EntityHandler[entity.Comic]{\n\t\tcomicService,\n\t\tresponder.Responder{},\n\t}\n\n\ttests := []httptester.HTTPTest{\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tURL:    \"/v1/user\",\n\t\t\tBody:   nil,\n\t\t\tTests: []httptester.TestCase{\n\t\t\t\t{\n\t\t\t\t\tPost: func(res *httptest.ResponseRecorder) {\n\t\t\t\t\t\t// should respond with latest\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tURL:    \"/v1/user?latest\",\n\t\t\tBody:   nil,\n\t\t\tTests: []httptester.TestCase{\n\t\t\t\t{\n\t\t\t\t\tPost: func(res *httptest.ResponseRecorder) {\n\t\t\t\t\t\t// should respond with latest\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tURL:    \"/v1/user?first\",\n\t\t\tBody:   nil,\n\t\t\tTests: []httptester.TestCase{\n\t\t\t\t{\n\t\t\t\t\tPost: func(res *httptest.ResponseRecorder) {\n\t\t\t\t\t\t// should respond with first\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tURL:    \"/v1/user?start=01-02-1988\",\n\t\t\tBody:   nil,\n\t\t\tTests: []httptester.TestCase{\n\t\t\t\t{\n\t\t\t\t\tPost: func(res *httptest.ResponseRecorder) {\n\t\t\t\t\t\t// should fail because end is require\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tURL:    \"/v1/user?end=01-02-1988\",\n\t\t\tBody:   nil,\n\t\t\tTests: []httptester.TestCase{\n\t\t\t\t{\n\t\t\t\t\tPost: func(res *httptest.ResponseRecorder) {\n\t\t\t\t\t\t// should fail because start is require\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tURL:    \"/v1/user?start=01-02-1988end=02-29-2022\",\n\t\t\tBody:   nil,\n\t\t\tTests: []httptester.TestCase{\n\t\t\t\t{\n\t\t\t\t\tPost: func(res *httptest.ResponseRecorder) {\n\t\t\t\t\t\t// should fail because it's an invalid date\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tURL:    \"/v1/user?start=01-02-1988end=02-29-2022\",\n\t\t\tBody:   nil,\n\t\t\tTests: []httptester.TestCase{\n\t\t\t\t{\n\t\t\t\t\tPost: func(res *httptest.ResponseRecorder) {\n\t\t\t\t\t\t// should respond with comics in the valid range\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, el := range tests {\n\t\tel.Execute(t, comicHandler.Get)\n\t}\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfirebaugh%2Fhttptester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfirebaugh%2Fhttptester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfirebaugh%2Fhttptester/lists"}