domtest

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseReaderDocument added in v0.2.0

func ParseReaderDocument(t TestingT, r io.Reader) spec.Document

func ParseReaderDocumentFragment added in v0.2.0

func ParseReaderDocumentFragment(t TestingT, r io.Reader, parent atom.Atom) spec.DocumentFragment

func ParseResponseDocument added in v0.2.0

func ParseResponseDocument(t TestingT, res *http.Response) spec.Document

func ParseResponseDocumentFragment added in v0.2.0

func ParseResponseDocumentFragment(t TestingT, res *http.Response, parent atom.Atom) spec.DocumentFragment

func ParseStringDocument added in v0.2.0

func ParseStringDocument(t TestingT, s string) spec.Document

Types

type Case added in v0.2.0

type Case[T TestingT, F any] struct {
	Name  string
	Given GivenFunc[T, F]
	When  func(t T) *http.Request
	Then  ThenFunc[T, F]
}

func (Case[TestingT, F]) Run added in v0.2.0

func (tc Case[TestingT, F]) Run(handler func(f F) http.Handler) func(t TestingT)

type DocumentTestFunc added in v0.2.0

type DocumentTestFunc[T TestingT, F any] func(t T, document spec.Document, f F)

type FragmentTestFunc added in v0.2.0

type FragmentTestFunc[T TestingT, F any] func(t T, fragment spec.DocumentFragment, f F)

type GivenFunc added in v0.3.0

type GivenFunc[T TestingT, F any] func(t T) F

func GivenPtr added in v0.3.0

func GivenPtr[T TestingT, F *Dereferenced, Dereferenced any](given func(t T, f F)) GivenFunc[T, F]

type QuerySelectorFunc added in v0.2.0

type QuerySelectorFunc[T TestingT, F any] func(t T, element spec.Element, f F)

type TestingT added in v0.2.0

type TestingT interface {
	Helper()
	Error(...any)
	Log(...any)
	Errorf(format string, args ...interface{})
	FailNow()
	Failed() bool
	SkipNow()
}

type ThenFunc added in v0.2.0

type ThenFunc[T TestingT, F any] func(t T, res *http.Response, f F)

func Document added in v0.2.0

func Document[T TestingT, F any](then DocumentTestFunc[T, F]) ThenFunc[T, F]

func Fragment added in v0.2.0

func Fragment[T TestingT, F any](parent atom.Atom, then FragmentTestFunc[T, F]) ThenFunc[T, F]

func QuerySelector

func QuerySelector[T TestingT, F any](query string, then QuerySelectorFunc[T, F]) ThenFunc[T, F]

Directories

Path Synopsis
example
blog/internal/fake
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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