(exitCode)
| 16 | function noop() {} |
| 17 | |
| 18 | function runCallChecks(exitCode) { |
| 19 | if (exitCode !== 0) return; |
| 20 | |
| 21 | const failed = mustCallChecks.filter((context) => { |
| 22 | if ('minimum' in context) { |
| 23 | context.messageSegment = `at least ${context.minimum}`; |
| 24 | return context.actual < context.minimum; |
| 25 | } |
| 26 | context.messageSegment = `exactly ${context.exact}`; |
| 27 | return context.actual !== context.exact; |
| 28 | }); |
| 29 | |
| 30 | failed.forEach((context) => { |
| 31 | console.error('Mismatched %s function calls. Expected %s, actual %d.', |
| 32 | context.name, |
| 33 | context.messageSegment, |
| 34 | context.actual); |
| 35 | console.error(context.stack.split('\n').slice(2).join('\n')); |
| 36 | }); |
| 37 | |
| 38 | if (failed.length) |
| 39 | process.exit(1); |
| 40 | } |
| 41 | |
| 42 | function mustCall(fn, exact) { |
| 43 | return _mustCallInner(fn, exact, 'exact'); |
nothing calls this directly
no test coverage detected
searching dependent graphs…