MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / main

Function main

apps/api/scripts/test-manage-api.ts:300–338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

298}
299
300async function main() {
301 console.log('🚀 Testing Manage API Endpoints\n');
302 console.log(`API Base URL: ${API_BASE_URL}`);
303 console.log(`Client ID: ${CLIENT_ID}\n`);
304
305 try {
306 // Test projects first (creates a project we can use for other tests)
307 const { projectId } = await testProjects();
308
309 // Test clients
310 await testClients(projectId);
311
312 // Test references (requires a project)
313 await testReferences(projectId);
314
315 // Summary
316 console.log(`\n${'='.repeat(60)}`);
317 console.log('📊 Test Summary\n');
318 const successful = results.filter((r) => r.success).length;
319 const failed = results.filter((r) => !r.success).length;
320
321 console.log(`Total tests: ${results.length}`);
322 console.log(`✅ Successful: ${successful}`);
323 console.log(`❌ Failed: ${failed}\n`);
324
325 if (failed > 0) {
326 console.log('Failed tests:');
327 results
328 .filter((r) => !r.success)
329 .forEach((r) => {
330 console.log(` ❌ ${r.name} (${r.status})`);
331 if (r.error) console.log(` Error: ${r.error}`);
332 });
333 }
334 } catch (error) {
335 console.error('Fatal error:', error);
336 process.exit(1);
337 }
338}
339
340main().catch(console.error);

Callers 1

test-manage-api.tsFile · 0.70

Calls 5

testProjectsFunction · 0.85
testClientsFunction · 0.85
testReferencesFunction · 0.85
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected