Ensures that value is true in a boolean context, anything but false, 0, '', null, undefined or NaN. Use this method when you don't care about the specific value.
false
0
''
null
undefined
NaN
Usage
const value = { example: 'value' };expect(value).toBeTruthy(); Copy
const value = { example: 'value' };expect(value).toBeTruthy();
Internal options that provide extra context for the matcher.
Received value.
Ensures that value is true in a boolean context, anything but
false,0,'',null,undefinedorNaN. Use this method when you don't care about the specific value.Usage