jester

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 8 Imported by: 0

README

jester

jester is an experimental go-testing library that brings jest / vitest style test structure and assertions to go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assertion

type Assertion struct {
	ActualValue any
	Testname    string
	T           *testing.T
}

func Expect

func Expect(t *testing.T, actualValue any) *Assertion

func (*Assertion) NotToBe

func (a *Assertion) NotToBe(nonExpectedValue any)

func (*Assertion) NotToBeNil

func (a *Assertion) NotToBeNil()

func (*Assertion) ToBe

func (a *Assertion) ToBe(expectedValue any)

func (*Assertion) ToBeNil

func (a *Assertion) ToBeNil()

func (*Assertion) ToContainJSON

func (a *Assertion) ToContainJSON(expectedJSON string)

func (*Assertion) ToMatchJSON

func (a *Assertion) ToMatchJSON(expectedJSON string)

func (*Assertion) ToMatchPattern

func (a *Assertion) ToMatchPattern(pattern string)

TODO: Make the string parsing more robust and universal Example: When calling err.Error() but the error is nil, the test suite immediately throws a nil pointer dereference error (ugly). Instead what I would love to have is a situation where the matcher tries to parse the error to string and notices that the error is nil (Expected xxx to be a string, but is nil instead)

Jump to

Keyboard shortcuts

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