MCPcopy Create free account
hub / github.com/AI45Lab/Code / runTest

Function runTest

sdk/node/examples/basic/test_generate_object.ts:51–62  ·  view source on GitHub ↗
(name: string, fn: () => Promise<void>)

Source from the content-addressed store, hash-verified

49const results: TestResult[] = [];
50
51async function runTest(name: string, fn: () => Promise<void>): Promise<void> {
52 const start = Date.now();
53 try {
54 await fn();
55 results.push({ name, passed: true, durationMs: Date.now() - start });
56 console.log(` ✓ PASS (${Date.now() - start}ms): ${name}`);
57 } catch (e) {
58 results.push({ name, passed: false, error: String(e), durationMs: Date.now() - start });
59 console.log(` ✗ FAIL (${Date.now() - start}ms): ${name}`);
60 console.log(` Error: ${e}`);
61 }
62}
63
64// ============================================================================
65// Tests

Callers 1

mainFunction · 0.85

Calls 1

logMethod · 0.45

Tested by

no test coverage detected