Documentation ¶
Overview ¶
Package chttptest provides utility functions that are useful when testing chttp
Index ¶
Constants ¶
View Source
const ContentTypeApplicationJSON = "application/json"
ContentTypeApplicationJSON defines the application/json content type that can be used when making HTTP requests.
Variables ¶
View Source
var HTMLDir embed.FS
HTMLDir embeds a directory that can be used with chttp.ReaderWriter
Functions ¶
func NewReaderWriter ¶
func NewReaderWriter(t *testing.T) *chttp.ReaderWriter
NewReaderWriter creates a *chttp.ReaderWriter suitable for use in tests
func PingRoutes ¶
PingRoutes creates a handler using chttp.NewHandler, starts a test http server, and calls each provided route. It verifies that each route's handler is called successfully.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.