Skip to main content
Glama
run.js•2.54 kB
#!/usr/bin/env node /** * Test Runner for Gravity MCP * Runs all test suites and reports results */ import authTests from './authentication.test.js'; import formsTests from './forms.test.js'; import entriesTests from './entries.test.js'; import feedsTests from './feeds.test.js'; import submissionsTests from './submissions.test.js'; import serverToolsTests from './server-tools.test.js'; // Test suites to run const testSuites = [ authTests, formsTests, entriesTests, feedsTests, submissionsTests, serverToolsTests ]; // Test statistics let totalPassed = 0; let totalFailed = 0; let allFailures = []; console.log('šŸš€ Gravity MCP Test Suite'); console.log('=====================================\n'); // Run all test suites async function runAllTests() { const startTime = Date.now(); for (const suite of testSuites) { const result = await suite.run(); totalPassed += result.passed; totalFailed += result.failed; if (result.failures && result.failures.length > 0) { allFailures.push(...result.failures.map(f => ({ suite: suite.name, ...f }))); } } const endTime = Date.now(); const duration = ((endTime - startTime) / 1000).toFixed(2); // Print final summary console.log('\n' + '='.repeat(60)); console.log('šŸ“Š FINAL TEST RESULTS'); console.log('='.repeat(60)); console.log(`\nāœ… Passed: ${totalPassed}`); console.log(`āŒ Failed: ${totalFailed}`); console.log(`ā±ļø Duration: ${duration}s`); const passRate = totalPassed + totalFailed > 0 ? ((totalPassed / (totalPassed + totalFailed)) * 100).toFixed(1) : 0; console.log(`šŸ“ˆ Pass Rate: ${passRate}%`); // Print all failures if any if (allFailures.length > 0) { console.log('\n' + '='.repeat(60)); console.log('āŒ FAILED TESTS SUMMARY'); console.log('='.repeat(60)); allFailures.forEach((failure, index) => { console.log(`\n${index + 1}. [${failure.suite}] ${failure.test}`); console.log(` Error: ${failure.error}`); }); } // Exit with appropriate code if (totalFailed > 0) { console.log('\nāŒ Tests failed! Please fix the issues above.'); process.exit(1); } else { console.log('\nāœ… All tests passed! Great job!'); process.exit(0); } } // Handle errors process.on('unhandledRejection', (error) => { console.error('\nāŒ Unhandled error in tests:', error); process.exit(1); }); // Run tests runAllTests().catch(error => { console.error('\nāŒ Test runner failed:', error); process.exit(1); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GravityKit/gravity-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server