MCPcopy Create free account
hub / github.com/SethGammon/Citadel / test

Function test

scripts/verify-hooks.js:100–117  ·  view source on GitHub ↗
(name, fn)

Source from the content-addressed store, hash-verified

98
99const results = [];
100
101function test(name, fn) {
102 const start = Date.now();
103 let passed = false;
104 let detail = '';
105 try {
106 const result = fn();
107 passed = result === true || result === undefined;
108 if (typeof result === 'string') { passed = false; detail = result; }
109 } catch (e) {
110 detail = e.message;
111 }
112 const ms = Date.now() - start;
113 results.push({ name, passed, detail, ms });
114 const icon = passed ? 'PASS' : 'FAIL';
115 const suffix = detail ? `\n ${detail}` : '';
116 console.log(` ${icon} ${name}${suffix}`);
117 if (VERBOSE && detail) console.log(` ${detail}`);
118}
119
120// ── Phase 1: Install verification ─────────────────────────────────────────────

Callers 1

verify-hooks.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected