Skip to content

@unthrown/vitest


@unthrown/vitest

Type Aliases

UnthrownMatchers

ts
type UnthrownMatchers<R> = object;

Defined in: index.ts:164

The matchers @unthrown/vitest contributes to Vitest's expect. For an AsyncResult, await the assertion; toBeOkWith compares deeply.

Type Parameters

Type ParameterDefault typeDescription
Runknownthe assertion's chaining return type.

Properties

PropertyTypeDescriptionDefined in
toBeDefect() => R-index.ts:175
toBeErr() => R-index.ts:167
toBeErrTagged(tag, expected?) => RAssert an Err whose error has _tag === tag. Optionally pass expected to also match the error's payload (its own props minus _tag/name): a plain object matches exactly, an asymmetric matcher (e.g. expect.objectContaining(...)) matches partially.index.ts:174
toBeOk() => R-index.ts:165
toBeOkWith(value) => R-index.ts:166

Functions

toBeDefect()

ts
function toBeDefect(this, received): ExpectationResult;

Defined in: index.ts:140

Parameters

ParameterType
thisMatcherState
receivedunknown

Returns

ExpectationResult


toBeErr()

ts
function toBeErr(this, received): ExpectationResult;

Defined in: index.ts:100

Parameters

ParameterType
thisMatcherState
receivedunknown

Returns

ExpectationResult


toBeErrTagged()

ts
function toBeErrTagged(
   this, 
   received, 
   tag, 
   expected?): ExpectationResult;

Defined in: index.ts:114

Parameters

ParameterType
thisMatcherState
receivedunknown
tagstring
expected?unknown

Returns

ExpectationResult


toBeOk()

ts
function toBeOk(this, received): ExpectationResult;

Defined in: index.ts:71

Parameters

ParameterType
thisMatcherState
receivedunknown

Returns

ExpectationResult


toBeOkWith()

ts
function toBeOkWith(
   this, 
   received, 
   expected): ExpectationResult;

Defined in: index.ts:85

Parameters

ParameterType
thisMatcherState
receivedunknown
expectedunknown

Returns

ExpectationResult

Released under the MIT License.