Jest · Matcher
toBeTruthy
toBeTruthy() checks that a value behaves like true in a JavaScript boolean context. Use it when the exact value is not important.
Last updated
Syntax
expect(value).toBeTruthy()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
toBeFalsy()toBeDefined()toBeUndefined()toBeNull()toBe()expect(value)