MCPcopy
hub / github.com/jestjs/jest / toBeTruthy

Function toBeTruthy

packages/expect/src/matchers.ts:427–444  ·  view source on GitHub ↗
(received: unknown, expected: void)

Source from the content-addressed store, hash-verified

425 },
426
427 toBeTruthy(received: unknown, expected: void) {
428 const matcherName = 'toBeTruthy';
429 const options: MatcherHintOptions = {
430 isNot: this.isNot,
431 promise: this.promise,
432 };
433 ensureNoExpected(expected, matcherName, options);
434
435 const pass = !!received;
436
437 const message = () =>
438 // eslint-disable-next-line prefer-template
439 matcherHint(matcherName, undefined, '', options) +
440 '\n\n' +
441 `Received: ${printReceived(received)}`;
442
443 return {message, pass};
444 },
445
446 toBeUndefined(received: unknown, expected: void) {
447 const matcherName = 'toBeUndefined';

Callers

nothing calls this directly

Calls 1

ensureNoExpectedFunction · 0.90

Tested by

no test coverage detected