Documentation
¶
Overview ¶
Package burrowtest provides test helpers for code that uses the burrow framework. It mirrors the standard-library convention of putting test utilities in a sibling sub-package (httptest, fstest, iotest), keeping the production package's import graph free of test-only dependencies.
Importing burrowtest blank-imports the SQLite Den backend, since DB opens a SQLite database. Production binaries that do not import this package therefore do not link the SQLite engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DB ¶
DB returns a file-backed SQLite database wrapped in a den.DB for testing. Struct-tag validation is always-on at the Den layer. The database is created in testing.T.TempDir and closed automatically when the test finishes.
func ErrorExecContext ¶
ErrorExecContext returns a context with a minimal burrow.TemplateExecutor that renders error templates as "<code>: <message>". Use this in tests that trigger error responses through burrow.Handle or burrow.RenderError.
func ErrorExecMiddleware ¶
ErrorExecMiddleware is an HTTP middleware that injects ErrorExecContext into the request context. Use this in tests that need error rendering support.
func StubApp ¶ added in v0.20.0
StubApp returns a minimal burrow.App that exposes only the given name. Use it in tests to satisfy a contrib's burrow.HasDependencies declaration when the test doesn't actually exercise the depended-on contrib's behaviour.
Types ¶
This section is empty.