Vitest · Function
expect
Vitest's expect function creates runtime assertions. It supports Chai-style and Jest-style matchers, and a second argument can provide a custom failure message.
Last updated
Syntax
expect<T>(actual: T, message?: string): Assertion<void, T>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
assertexpect.softexpect.pollnottoBetoEqualtoBeCloseToexpectTypeOf