(callback, expectation)
| 8 | 'use strict'; |
| 9 | |
| 10 | function 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 | |
| 23 | expect.extend({ |
| 24 | toCustomMatch, |
nothing calls this directly
no test coverage detected