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

Function toCustomMatch

e2e/custom-matcher-stack-trace/__tests__/sync.test.js:10–21  ·  view source on GitHub ↗
(callback, expectation)

Source from the content-addressed store, hash-verified

8'use strict';
9
10function toCustomMatch(callback, expectation) {
11 const actual = callback();
12
13 if (actual === expectation) {
14 return {pass: true};
15 } else {
16 return {
17 message: () => `Expected "${expectation}" but got "${actual}"`,
18 pass: false,
19 };
20 }
21}
22
23expect.extend({
24 toCustomMatch,

Callers

nothing calls this directly

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected