Help us shape the future of Go! Take the 2026 Go Developer Survey

jsonapitest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertJSONAPIEq

func AssertJSONAPIEq(t *testing.T, want string, got string) bool

func NewRequest deprecated

func NewRequest(method string, target string, doc jsonapi.Document) *http.Request

NewRequest creates a new http.Request using a jsonapi.Document as payload, suitable for passing to an http.Handler for testing.

Deprecated: Use httptest.NewRequest() directly, with jsonapitest.Document as a payload.

Types

type Body added in v0.2.0

type Body jsonapi.Document

Body is a wrapper around jsonapi.Document that implements the io.Reader interface. Use as a payload in httptest.NewRequest() calls.

func (Body) Read added in v0.2.0

func (p Body) Read(b []byte) (int, error)

Read implements the io.Reader interface.

Jump to

Keyboard shortcuts

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