testutil

package
v0.0.0-...-a8164e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package testutil provides test helpers for Broth applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertStatus

func AssertStatus(t *testing.T, resp *http.Response, expected int)

AssertStatus fails the test if the response status code does not match expected.

func NewTestServer

func NewTestServer(t *testing.T, handler http.Handler) *httptest.Server

NewTestServer creates an httptest.Server for the given handler and registers cleanup to close it when the test finishes.

func SetupTestDB

func SetupTestDB(t *testing.T) *sql.DB

SetupTestDB creates a test database connection using the TEST_DATABASE_URL environment variable and registers cleanup.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL