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

Function toBeUndefined

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

Source from the content-addressed store, hash-verified

444 },
445
446 toBeUndefined(received: unknown, expected: void) {
447 const matcherName = 'toBeUndefined';
448 const options: MatcherHintOptions = {
449 isNot: this.isNot,
450 promise: this.promise,
451 };
452 ensureNoExpected(expected, matcherName, options);
453
454 const pass = received === void 0;
455
456 const message = () =>
457 // eslint-disable-next-line prefer-template
458 matcherHint(matcherName, undefined, '', options) +
459 '\n\n' +
460 `Received: ${printReceived(received)}`;
461
462 return {message, pass};
463 },
464
465 toContain(received: ContainIterable | string, expected: unknown) {
466 const matcherName = 'toContain';

Callers

nothing calls this directly

Calls 1

ensureNoExpectedFunction · 0.90

Tested by

no test coverage detected