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

Function sequence

scripts/integration-test.js:218–234  ·  view source on GitHub ↗
(name, fn, sandbox)

Source from the content-addressed store, hash-verified

216
217const results = [];
218
219function sequence(name, fn, sandbox) {
220 const start = Date.now();
221 let passed = false;
222 let detail = '';
223 try {
224 const r = fn(sandbox);
225 passed = r === true || r === undefined;
226 if (typeof r === 'string') { passed = false; detail = r; }
227 } catch (e) {
228 detail = e.message;
229 }
230 const ms = Date.now() - start;
231 results.push({ name, passed, detail, ms });
232 const icon = passed ? 'PASS' : 'FAIL';
233 const suffix = detail ? `\n ${detail}` : '';
234 console.log(` ${icon} ${name}${suffix}`);
235}
236
237// ── Sequences ─────────────────────────────────────────────────────────────────

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected