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 enabled by default to match github.com/oliverandrich/burrow.OpenDB. 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.
Types ¶
This section is empty.