MCPcopy Create free account
hub / github.com/mscdex/ssh2 / runCallChecks

Function runCallChecks

test/common.js:18–40  ·  view source on GitHub ↗
(exitCode)

Source from the content-addressed store, hash-verified

16function noop() {}
17
18function 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
42function mustCall(fn, exact) {
43 return _mustCallInner(fn, exact, 'exact');

Callers

nothing calls this directly

Calls 1

exitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…