Skip to main content
Glama

In Memoria

run-all.jsโ€ข2.89 kB
#!/usr/bin/env node import { spawn } from 'child_process'; import { readdir } from 'fs/promises'; import { join } from 'path'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const TESTS_TO_SKIP = ['run-all.js', 'README.md']; async function runTest(testFile) { console.log(`\n${'='.repeat(60)}`); console.log(`๐Ÿงช Running: ${testFile}`); console.log(`${'='.repeat(60)}\n`); return new Promise((resolve) => { const child = spawn('node', [join(__dirname, testFile)], { stdio: 'inherit', cwd: process.cwd() }); child.on('close', (code) => { if (code === 0) { console.log(`\nโœ… ${testFile} completed successfully`); } else { console.log(`\nโŒ ${testFile} failed with code ${code}`); } resolve(code); }); child.on('error', (error) => { console.error(`\n๐Ÿ’ฅ ${testFile} error:`, error.message); resolve(1); }); }); } async function runAllTests() { console.log('๐Ÿš€ Running all manual integration tests...\n'); console.log('โ„น๏ธ Make sure to run "npm run build" first!\n'); try { const files = await readdir(__dirname); const testFiles = files.filter(file => file.startsWith('test-') && file.endsWith('.js') && !TESTS_TO_SKIP.includes(file) ); if (testFiles.length === 0) { console.log('No test files found!'); process.exit(1); } console.log(`Found ${testFiles.length} test files:\n${testFiles.map(f => ` - ${f}`).join('\n')}\n`); let passed = 0; let failed = 0; for (const testFile of testFiles) { const result = await runTest(testFile); if (result === 0) { passed++; } else { failed++; } } console.log(`\n${'='.repeat(60)}`); console.log(`๐Ÿ“Š TEST SUMMARY`); console.log(`${'='.repeat(60)}`); console.log(`โœ… Passed: ${passed}`); console.log(`โŒ Failed: ${failed}`); console.log(`๐Ÿ“Š Total: ${passed + failed}`); if (failed > 0) { console.log(`\nโš ๏ธ Some tests failed. Check output above for details.`); process.exit(1); } else { console.log(`\n๐ŸŽ‰ All manual tests passed!`); process.exit(0); } } catch (error) { console.error('Error running tests:', error); process.exit(1); } } // Handle command line arguments const args = process.argv.slice(2); if (args.length > 0) { // Run specific test const testFile = args[0]; if (!testFile.startsWith('test-') || !testFile.endsWith('.js')) { console.error('Test file must start with "test-" and end with ".js"'); process.exit(1); } console.log(`๐Ÿงช Running specific test: ${testFile}\n`); runTest(testFile).then(code => process.exit(code)); } else { // Run all tests runAllTests(); }

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/pi22by7/In-Memoria'

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