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

Function main

sdk/node/examples/basic/test_api_alignment.ts:285–317  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283// ---------------------------------------------------------------------------
284
285async function main() {
286 if (!apiKey) {
287 console.log('\n SKIP: KIMI_API_KEY not set — skipping live LLM tests');
288 skip('live LLM tests', 'KIMI_API_KEY not set');
289 } else {
290 await runLiveTests(apiKey);
291 }
292
293 // ---------------------------------------------------------------------------
294 // Summary
295 // ---------------------------------------------------------------------------
296
297 section('Summary');
298
299 const total = results.length;
300 const passed = results.filter((r) => r.status === 'PASS').length;
301 const failed = results.filter((r) => r.status === 'FAIL').length;
302 const skipped = results.filter((r) => r.status === 'SKIP').length;
303
304 console.log(`\n Total: ${total} Passed: ${passed} Failed: ${failed} Skipped: ${skipped}`);
305
306 if (failed > 0) {
307 console.log('\n Failed tests:');
308 for (const { name, status, detail } of results) {
309 if (status === 'FAIL') {
310 console.log(` ✗ ${name}: ${detail}`);
311 }
312 }
313 }
314
315 console.log();
316 process.exit(failed === 0 ? 0 : 1);
317}
318
319main().catch((e) => {
320 console.error(`Unexpected error: ${e}`);

Callers 1

Calls 4

skipFunction · 0.85
runLiveTestsFunction · 0.85
sectionFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected