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

Function toBeNull

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

Source from the content-addressed store, hash-verified

406 },
407
408 toBeNull(received: unknown, expected: void) {
409 const matcherName = 'toBeNull';
410 const options: MatcherHintOptions = {
411 isNot: this.isNot,
412 promise: this.promise,
413 };
414 ensureNoExpected(expected, matcherName, options);
415
416 const pass = received === null;
417
418 const message = () =>
419 // eslint-disable-next-line prefer-template
420 matcherHint(matcherName, undefined, '', options) +
421 '\n\n' +
422 `Received: ${printReceived(received)}`;
423
424 return {message, pass};
425 },
426
427 toBeTruthy(received: unknown, expected: void) {
428 const matcherName = 'toBeTruthy';

Callers

nothing calls this directly

Calls 1

ensureNoExpectedFunction · 0.90

Tested by

no test coverage detected