UNPKG

@fgv/ts-utils-jest

Version:
23 lines 912 B
import { matcherHint } from 'jest-matcher-utils'; import { toMatchInlineSnapshot } from 'jest-snapshot'; import { printReceivedResult } from '../../utils/matcherHelpers'; const matcherName = 'toSucceedAndMatchInlineSnapshot'; export default { toSucceedAndMatchInlineSnapshot: function (received, snapshot) { const context = this; if (received.isFailure()) { return { pass: false, message: () => { return [ matcherHint(`${matcherName}`, 'callback'), 'Expected:\n Callback to succeed with a result that matches the snapshot', printReceivedResult(received) ].join('\n'); } }; } return toMatchInlineSnapshot.call(context, received.value, {}, snapshot); } }; //# sourceMappingURL=index.js.map