exampletest

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package exampletest runs examples through the HTTP adapters (net/http and AWS API Gateway HTTP API payload 2.0).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, routes []µ.Routable, cases []Case)

Run executes cases against the routes using every adapter

Types

type Case

type Case struct {
	Name   string
	Method string // GET by default
	Path   string
	Query  url.Values
	Header map[string]string
	Body   string

	Status   int    // 200 by default
	Contains string // substring of the response body
}

Case is a request and the expectations about the response

Jump to

Keyboard shortcuts

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