# `Issho.Test`
[🔗](https://github.com/hattoriai/issho/blob/v0.1.0/lib/issho/test.ex#L1)

Helpers for testing an app or a binding with Issho, in ExUnit.

    setup do
      instance = Issho.Test.start!(policy: MyApp.Collaboration)
      %{instance: instance}
    end

    test "an agent drafts a title", %{instance: instance} do
      {:ok, agent} = Issho.join_as(instance, %{id: "agent:1", kind: :agent}, "board:1")
      {:ok, _} = Issho.Participant.open(agent, "board:1")
      {:ok, _} = Issho.Participant.transact(agent, "board:1", ops)
      assert Issho.Test.replays?(instance, "board:1")
    end

`start!/1` starts an isolated instance for the test: its own PubSub, a
store in memory, quick awareness frames, and no `Issho.Presence` unless
you ask (`presence: true`; only one runs on a node).

# `replays?`

```elixir
@spec replays?(atom(), String.t()) :: boolean()
```

Whether replaying a document's journal from the start of its epoch gives
its current content: the engine is deterministic, and nothing changed
the state outside a transaction. A conformance check for engines.

# `start!`

```elixir
@spec start!(keyword()) :: atom()
```

Starts an isolated instance under the test's supervisor and gives its
name. Options: `:policy` (required), and any option of `Issho`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
