Vitest · Matcher
toContain
toContain checks that an array or iterable contains a specific item. It can also check that a string contains a substring.
Last updated
Syntax
expect(received).toContain(expected)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
toContainEqualtoContainElementtoHaveLengthexpect