Behaviour for sandbox adapters.
Each adapter handles setup (once in test_helper), checkout (per test), and checkin (on_exit). The adapter returns an opaque token from checkout that is passed back to checkin.
Adapters can optionally declare plug and on_mount modules to be
registered in endpoints and LiveViews via sandbox_plugs() and
sandbox_on_mount().
Summary
Callbacks
Whether this adapter is available (deps loaded).
Per-test checkin. Receives the token from checkout.
Per-test checkout. Returns an opaque token or nil.
on_mount modules to register in LiveViews. Return [] if none.
Plug modules to register in the endpoint. Return [] if none.
Process dictionary keys to propagate to child processes. Return [] if none.
One-time setup in test_helper. Receives adapter-specific config.
Callbacks
@callback available?() :: boolean()
Whether this adapter is available (deps loaded).
@callback checkin(token :: term()) :: :ok
Per-test checkin. Receives the token from checkout.
Per-test checkout. Returns an opaque token or nil.
@callback hooks() :: [module()]
on_mount modules to register in LiveViews. Return [] if none.
@callback plugs() :: [module()]
Plug modules to register in the endpoint. Return [] if none.
Process dictionary keys to propagate to child processes. Return [] if none.
@callback setup(config :: term()) :: :ok
One-time setup in test_helper. Receives adapter-specific config.