Anise - Helpers/Assertions for Absinthe

Anise Is micro library for testing Absinthe queries, mutations, and most importantly Subscriptions.

I really think this library will really help newcomers because testing subscriptions are not that obvious:)

Example:

      test "sub with fufilment", %{socket: socket, conn: conn} do
      assert %{
               payload: %{subscriptionId: sub_id},
               status: :ok
             } = subscribe(socket, @subscription)

      graphql(conn, "/api", @mutation, %{email: "test@example.com", name: "Boris"})

      expected = %{result: %{data: %{"userAdded" => %{"name" => "Boris"}}}}
      assert_subscription_fulfilment fufilment
      assert fufilment = expected
    end
5 Likes

This looks pretty slick. :slight_smile: