Package: test

Testing utilities for Dracory apps — request builders, environment setup, HTTP endpoint testing.

Package: test

Testing utilities for Go applications in the Dracory ecosystem: tools for setting up test environments, managing test databases, and exercising HTTP endpoints.

Repository: https://github.com/dracory/test

Installation

go get github.com/dracory/test

Usage

func TestHomePage(t *testing.T) {
    response := test.NewRequest().Get("/").Response()
    if response.StatusCode() != 200 {
        t.Fatal("expected 200")
    }
}

Features

  • test.NewRequest() — fluent builder for issuing requests against a handler/router in tests.
  • Test environment helpers — configure and tear down test databases.
  • Used throughout the project's own test suite (internal/testutils complements it with app fixtures).