Skip to content

Latest commit

 

History

History
105 lines (78 loc) · 1.83 KB

core-be-matchers.md

File metadata and controls

105 lines (78 loc) · 1.83 KB

be

-- import "github.com/expectto/be"

Usage

var Ctx = be_ctx.Ctx

Ctx is an alias for be_ctx.Ctx

var HttpRequest = be_http.Request

HttpRequest is an alias for be_http.Request matcher

var JwtToken = be_jwt.Token

JwtToken is an alias for be_jwt.Token matcher

var StringAsTemplate = be_string.MatchTemplate

StringAsTemplate is an alias for be_string.MatchTemplate matcher

var URL = be_url.URL

URL is an alias for be_url.URL matcher

func All

func All(ms ...any) types.BeMatcher

All is like gomega.And()

func Always

func Always() types.BeMatcher

Always does always match

func Any

func Any(ms ...any) types.BeMatcher

Any is like gomega.Or()

func Dive

func Dive(matcher any) types.BeMatcher

Dive applies the given matcher to each (every) element of the slice. Note: Dive is very close to gomega.HaveEach

func DiveAny

func DiveAny(matcher any) types.BeMatcher

DiveAny applies the given matcher to each element and succeeds in case if it succeeds at least at one item

func DiveFirst

func DiveFirst(matcher any) types.BeMatcher

DiveFirst applies the given matcher to the first element of the given slice

func Eq

func Eq(expected any) types.BeMatcher

Eq is like gomega.Equal()

func HaveLength

func HaveLength(args ...any) types.BeMatcher

HaveLength is like gomega.HaveLen() HaveLength succeeds if the actual value has a length that matches the provided conditions. It accepts either a count value or one or more Gomega matchers to specify the desired length conditions.

func Never

func Never(err error) types.BeMatcher

Never does never succeed (does always fail)

func Not

func Not(expected any) types.BeMatcher

Not is like gomega.Not()