{"id":13833580,"url":"https://github.com/gen1321/anise","last_synced_at":"2025-03-21T07:31:21.135Z","repository":{"id":57478898,"uuid":"152985247","full_name":"gen1321/anise","owner":"gen1321","description":"Set of helpers/asserts for Absinthe","archived":false,"fork":false,"pushed_at":"2019-01-26T23:13:28.000Z","size":32,"stargazers_count":21,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T21:31:24.656Z","etag":null,"topics":["absinthe","absinthe-graphql","elixir","exunit","graphql"],"latest_commit_sha":null,"homepage":"","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/gen1321.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":"2018-10-14T14:53:21.000Z","updated_at":"2023-03-28T16:00:39.000Z","dependencies_parsed_at":"2022-09-17T04:21:42.762Z","dependency_job_id":null,"html_url":"https://github.com/gen1321/anise","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/gen1321%2Fanise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen1321%2Fanise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen1321%2Fanise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gen1321%2Fanise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gen1321","download_url":"https://codeload.github.com/gen1321/anise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244120015,"owners_count":20401070,"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":["absinthe","absinthe-graphql","elixir","exunit","graphql"],"created_at":"2024-08-04T12:00:51.221Z","updated_at":"2025-03-21T07:31:20.873Z","avatar_url":"https://github.com/gen1321.png","language":"Elixir","funding_links":[],"categories":["Running the update"],"sub_categories":["By Popularity"],"readme":"# Anise\n\nAnise is a set of helpers/assertions for Absinthe\n\n\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:anise, \"~\u003e 0.1.1\"}\n  ]\nend\n```\n\n## Usage\n\n### Without subscriptions\nAdd `use Anise` on top of your tests. \n\nThan you can do that.\n\n```elixir\ngraphql(conn, \"/api\", @mutation, %{email: \"test@example.com\", name: \"Boris\"})\n```\nsame for queries.\n\n### With subscriptions\nCreate `subscription_case.ex` in `test/support`.\n\n```elixir\ndefmodule MyAppWeb.SubscriptionCase do\n  use ExUnit.CaseTemplate\n\n  using do\n    quote do\n      @endpoint MyAppWeb.Endpoint\n      use Anise\n\n      use Anise.SubscriptionCase,\n        schema: MyAppWeb.Schema,\n        socket: MyAppWeb.UserSocket\n      end\n  end\n\n  setup do\n    :ok\n  end\nend\n\n```\nThen in your subscription tests add `use MyAppWeb.Subscription`\n\nNow you can test your subscriptions.\n\n```elixir\n  describe \"User add\" do\n    test \"valid data\", %{socket: socket, conn: conn} do\n      assert %{\n               payload: %{subscriptionId: sub_id},\n               status: :ok\n             } = subscribe(socket, @subscription)\n\n      graphql(conn, \"/api\", @mutation, %{email: \"test@example.com\", name: \"Boris\"})\n\n      expected = %{result: %{data: %{\"userAdded\" =\u003e %{\"name\" =\u003e \"Boris\"}}}}\n      assert_subscription_fulfilment fufilment\n      assert fufilment = expected\n    end\n  end\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen1321%2Fanise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgen1321%2Fanise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgen1321%2Fanise/lists"}