{"id":13509204,"url":"https://github.com/stevegraham/hypermock","last_synced_at":"2026-01-19T14:03:54.068Z","repository":{"id":34293957,"uuid":"38193086","full_name":"stevegraham/hypermock","owner":"stevegraham","description":"HTTP request stubbing and expectation Elixir library","archived":false,"fork":false,"pushed_at":"2015-11-14T11:42:08.000Z","size":164,"stargazers_count":24,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-06T19:10:57.651Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/stevegraham.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}},"created_at":"2015-06-28T09:16:50.000Z","updated_at":"2023-09-01T08:51:54.000Z","dependencies_parsed_at":"2022-09-14T03:31:13.028Z","dependency_job_id":null,"html_url":"https://github.com/stevegraham/hypermock","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/stevegraham%2Fhypermock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevegraham%2Fhypermock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevegraham%2Fhypermock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevegraham%2Fhypermock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevegraham","download_url":"https://codeload.github.com/stevegraham/hypermock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246323932,"owners_count":20759051,"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":[],"created_at":"2024-08-01T02:01:04.548Z","updated_at":"2026-01-19T14:03:54.062Z","avatar_url":"https://github.com/stevegraham.png","language":"Elixir","funding_links":[],"categories":["Testing"],"sub_categories":[],"readme":"# HyperMock\n\nHTTP request stubbing and expectation Elixir library. Intercepts HTTP calls and\neither returns a stubbed response if that request was stubbed or raises an error\nif a matching request was not found in the stubbed requests.\n\nThe idea is to provide tools to explicitly verify properties of the actual request\nrather than loose stubbing to return canned responses in your tests.\n\nUnused stubs in your tests will also raise errors.\n\n```elixir\ndefmodule RequestTest do\n  use HyperMock\n\n  def fail do\n    HyperMock.intercept do\n      # No expectations have been set. This will raise an error.\n      HTTPotion.get \"http://example.com:3000/users\", [body: \"hello=world\", headers: [\"User-Agent\": \"My App\"]]\n    end\n  end\n\n  def yay do\n    HyperMock.intercept do\n      request  = %Request{ method: :get, uri: \"http://lol.biz.info\", headers: [\"User-Agent\": \"My App\"] }\n      response = %Response{ body: \"LOOOOOOOOOOOOL m8!\" }\n\n      stub_request request, response\n\n      # This will return a HTTPotion.Response struct with a 200 status and body of \"LOOOOOOOOOOOOL m8!\"\n      HTTPotion.get(\"http://lol.biz.info\", headers: [\"User-Agent\": \"My App\"]) |\u003e inspect |\u003e IO.puts\n    end\n  end\nend\n```\n\n# Limitations\n\nOnly works with ibrowse synchronous requests right now. If you want to add support\nfor asynchronous requests or another client open an issue and let's talk about it :)\n\n# Contributing\n\nIf you have an idea please open an issue to start discussion first. The feature may\nhave been discussed previously or in development.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevegraham%2Fhypermock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevegraham%2Fhypermock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevegraham%2Fhypermock/lists"}