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

Function toBeDefined

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

Source from the content-addressed store, hash-verified

213 },
214
215 toBeDefined(received: unknown, expected: void) {
216 const matcherName = 'toBeDefined';
217 const options: MatcherHintOptions = {
218 isNot: this.isNot,
219 promise: this.promise,
220 };
221 ensureNoExpected(expected, matcherName, options);
222
223 const pass = received !== void 0;
224
225 const message = () =>
226 // eslint-disable-next-line prefer-template
227 matcherHint(matcherName, undefined, '', options) +
228 '\n\n' +
229 `Received: ${printReceived(received)}`;
230
231 return {message, pass};
232 },
233
234 toBeFalsy(received: unknown, expected: void) {
235 const matcherName = 'toBeFalsy';

Callers

nothing calls this directly

Calls 1

ensureNoExpectedFunction · 0.90

Tested by

no test coverage detected