# `PhoenixMountable.Test`
[🔗](https://github.com/hattoriai/phoenix_mountable/blob/v0.2.1/lib/phoenix_mountable/test_host.ex#L161)

Helpers for testing a mountable library.

    use PhoenixMountable.Test, host: MyLib.TestHost

imports `Plug.Conn`, `Phoenix.ConnTest` and `Phoenix.LiveViewTest` (when
available), sets `@endpoint` to the host's (see
`PhoenixMountable.TestHost`), and adds a `conn` with an empty session to
each test's context.

`build_mount/3` builds a mount without a router, to test the library's
options, `c:PhoenixMountable.normalize_options/1` and
`c:PhoenixMountable.session/3`.

# `build_mount`

```elixir
@spec build_mount(module(), String.t(), keyword()) :: PhoenixMountable.Mount.t()
```

The mount a host would get with `my_lib path, opts`, validated and
normalized like the mount macro does, but without a router.

    mount = PhoenixMountable.Test.build_mount(MyLib.Router, "/my_lib", features: [:beta])
    assert mount.options.features == [:beta]

---

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