Vitest · Matcher
toBeOneOf
toBeOneOf checks whether a value matches at least one item in an array or set. It uses the same deep equality as toEqual and supports negation with expect.not.
Last updated
Syntax
expect(actual).toBeOneOf(sample)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expect.nottoEqualexpect.any