@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 Parameter | Default type | Description |
|---|---|---|
R | unknown | the assertion's chaining return type. |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
toBeDefect | () => R | - | index.ts:175 |
toBeErr | () => R | - | index.ts:167 |
toBeErrTagged | (tag, expected?) => R | Assert 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
| Parameter | Type |
|---|---|
this | MatcherState |
received | unknown |
Returns
ExpectationResult
toBeErr()
ts
function toBeErr(this, received): ExpectationResult;Defined in: index.ts:100
Parameters
| Parameter | Type |
|---|---|
this | MatcherState |
received | unknown |
Returns
ExpectationResult
toBeErrTagged()
ts
function toBeErrTagged(
this,
received,
tag,
expected?): ExpectationResult;Defined in: index.ts:114
Parameters
| Parameter | Type |
|---|---|
this | MatcherState |
received | unknown |
tag | string |
expected? | unknown |
Returns
ExpectationResult
toBeOk()
ts
function toBeOk(this, received): ExpectationResult;Defined in: index.ts:71
Parameters
| Parameter | Type |
|---|---|
this | MatcherState |
received | unknown |
Returns
ExpectationResult
toBeOkWith()
ts
function toBeOkWith(
this,
received,
expected): ExpectationResult;Defined in: index.ts:85
Parameters
| Parameter | Type |
|---|---|
this | MatcherState |
received | unknown |
expected | unknown |
Returns
ExpectationResult