SandboxShim
Compile-time macros for wiring test sandbox infrastructure into Phoenix endpoints and LiveViews. Emits nothing outside MIX_ENV=test. Zero runtime overhead, no production dependencies on test libraries.
Part of sandbox_case.
Installation
# mix.exs
{:sandbox_shim, "~> 0.1"}, # all envs, just macros
{:sandbox_case, "~> 0.3", only: :test}, # test runtimeUsage
# endpoint.ex
import SandboxShim
sandbox_plugs()
sandbox_socket "/live", Phoenix.LiveView.Socket,
websocket: [connect_info: [session: @session_options]]# your_app_web.ex
def live_view do
quote do
use Phoenix.LiveView
import SandboxShim
sandbox_on_mount()
end
endLicense
MIT