MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / test

Function test

tests/extension-fields.test.cjs:59–77  ·  view source on GitHub ↗
(description, testFn)

Source from the content-addressed store, hash-verified

57}
58
59async function test(description, testFn) {
60 totalTests++;
61 try {
62 const result = await testFn();
63 if (result === true || result === undefined) {
64 log(`✅ ${description}`, 'success');
65 passedTests++;
66 } else {
67 log(`❌ ${description}: ${result}`, 'error');
68 failedTests++;
69 }
70 } catch (error) {
71 log(`❌ ${description}: ${error.message}`, 'error');
72 if (error.errors) {
73 console.error('Validation errors:', JSON.stringify(error.errors, null, 2));
74 }
75 failedTests++;
76 }
77}
78
79// Cache for compiled schemas
80const schemaCache = new Map();

Calls 1

logFunction · 0.70

Tested by

no test coverage detected