Bandera. Store. ProcessScoped
(bandera v0.1.0)
Copy Markdown
Process-scoped overlay store for tests, backed by NimbleOwnership.
Flag state is owned per-process and resolved through the [self() | $callers]
chain (the same mechanism Mox and Ecto.Adapters.SQL.Sandbox use), so spawned
Tasks and LiveView processes inherit their test's overrides. A flag with no
override resolves to an empty (disabled) flag — overrides overlay on that static
default; no global mutable store is consulted, so async: true tests never bleed
into each other and flag writes never touch a database or fire notifications.
Configure it as the active store in the test environment:
# config/test.exs
config :bandera, store: Bandera.Store.ProcessScopedand start the ownership server once in test/test_helper.exs via
Bandera.Test.start/0. Per-test cleanup is automatic — NimbleOwnership monitors
the owning process and drops its state when the test process exits.
Summary
Functions
Start the backing NimbleOwnership server (named after this module).
Functions
@spec start_link(keyword()) :: GenServer.on_start()
Start the backing NimbleOwnership server (named after this module).