Skip to content
GitHub

MockSettledResult

interface in meocord/testing Since 4.2.1

interface MockSettledResult<T = unknown>

One call's outcome once it has settled, as a mock function records it.

It holds what a returned promise resolved or rejected with, or what the call returned or threw. Vitest's toHaveResolved and the rest read it.

Members

type

type: 'fulfilled' | 'rejected' | 'incomplete'

'fulfilled' once the call resolved or returned, 'rejected' once it rejected or threw, 'incomplete' before.

value

value: T | undefined

What the call resolved, returned, rejected or threw with; undefined while it is incomplete.

See also