matchers

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package matchers contains custom matches for use with the Gomega assertion library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeADOMError

func BeADOMError() GomegaMatcher

func BeHTMLElement

func BeHTMLElement() GomegaMatcher

func FormatDocument

func FormatDocument(value any) (result string, ok bool)

func FormatElement

func FormatElement(value any) (result string, ok bool)

func HaveAttribute

func HaveAttribute(name string, expected interface{}) GomegaMatcher

func HaveFormDataValue

func HaveFormDataValue(key, expected string) types.GomegaMatcher

func HaveH1

func HaveH1(expected string) GomegaMatcher

func HaveInnerHTML

func HaveInnerHTML(matcher GomegaMatcher) GomegaMatcher

func HaveOuterHTML

func HaveOuterHTML(expected interface{}) GomegaMatcher

func HaveTag

func HaveTag(expected string) GomegaMatcher

func HaveTextContent

func HaveTextContent(expected interface{}) GomegaMatcher

Types

type HtmlElementMatcher

type HtmlElementMatcher struct{}

func (HtmlElementMatcher) FailureMessage

func (m HtmlElementMatcher) FailureMessage(actual interface{}) (message string)

func (HtmlElementMatcher) Match

func (m HtmlElementMatcher) Match(value any) (bool, error)

func (HtmlElementMatcher) NegatedFailureMessage

func (m HtmlElementMatcher) NegatedFailureMessage(actual interface{}) (message string)

type MatcherScriptContext

type MatcherScriptContext interface {
	html.ScriptContext
	EvalCore(string) (any, error)
	RunFunction(string, ...any) (any, error)
	Export(any) (any, error)
}

MatcherScriptContext defines a set of functions a script context must support for the matchers to work.

type ScriptMatchers

type ScriptMatchers struct{ Ctx MatcherScriptContext }

func (ScriptMatchers) BeInstanceOf

func (m ScriptMatchers) BeInstanceOf(name string) types.GomegaMatcher

Jump to

Keyboard shortcuts

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