Skip to main content
Glama
test-create-package.js•2.49 kB
/** * Test CreatePackage handler * Tests creating ABAP packages */ const { initializeTestEnvironment, getAllEnabledTestCases, validateTransportRequest, printTestHeader, printTestParams, printTestResult, waitForConfirmation } = require('./test-helper'); // Initialize test environment initializeTestEnvironment(); const { handleCreatePackage } = require('../dist/handlers/handleCreatePackage'); async function testCreatePackage() { const testCases = getAllEnabledTestCases('create_package'); console.log(`\nšŸ“‹ Found ${testCases.length} enabled test case(s)\n`); let passedTests = 0; let failedTests = 0; for (const testCase of testCases) { printTestHeader('CreatePackage', testCase); const params = testCase.params; // Validate transport request if (!validateTransportRequest(params)) { await waitForConfirmation( 'āš ļø Using default transport request! Update test-config.yaml with a valid request.', 5 ); } printTestParams(params); console.log('--- Creating package ---\n'); try { const result = await handleCreatePackage(params); if (printTestResult(result, 'CreatePackage')) { passedTests++; // Try to extract package name from result for user reference try { if (result.content && result.content[0] && result.content[0].text) { const parsedResult = JSON.parse(result.content[0].text); if (parsedResult.package_name) { console.log(`\nšŸ’” Package created: ${parsedResult.package_name}`); console.log(` Use this package in other tests that require package_name`); } } } catch (e) { // Ignore parsing errors } } else { failedTests++; } } catch (error) { console.error('āŒ Unexpected error:'); console.error(error); failedTests++; } console.log('\n' + '='.repeat(60) + '\n'); } console.log(`\nšŸ“Š Test Summary:`); console.log(` āœ… Passed: ${passedTests}`); console.log(` āŒ Failed: ${failedTests}`); console.log(` šŸ“ Total: ${testCases.length}`); if (failedTests > 0) { process.exit(1); } } // Run the test testCreatePackage() .then(() => { console.log('\n=== All tests completed successfully ==='); process.exit(0); }) .catch(error => { console.error('\n=== Tests failed ==='); console.error(error); process.exit(1); });

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/fr0ster/mcp-abap-adt'

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