UNPKG

@rocketshipai/mcp-server

Version:

MCP assistant for helping AI coding agents write better Rocketship tests

73 lines • 3.08 kB
#!/usr/bin/env node "use strict"; /** * Simple test script to verify the MCP server can be imported and initialized */ Object.defineProperty(exports, "__esModule", { value: true }); const index_js_1 = require("./index.js"); async function runTests() { console.log('šŸš€ Testing Rocketship MCP Server...\n'); try { console.log('šŸ“¦ Testing server initialization...'); const server = new index_js_1.RocketshipMCPServer(); console.log('āœ… Server initialized successfully'); console.log('\nāš™ļø Testing dynamic knowledge loader...'); // Test that the dynamic loader works const exampleResponse = await server.handleGetExamples({ feature_type: 'http', use_case: 'API testing' }); if (exampleResponse.content && exampleResponse.content[0].text.includes('Real Rocketship Examples')) { console.log('āœ… Dynamic knowledge loader works'); } else { throw new Error('Dynamic knowledge loader failed'); } console.log('\nāš™ļø Testing test structure suggestions...'); const structureResponse = await server.handleSuggestStructure({ project_type: 'frontend', user_flows: ['login', 'dashboard'] }); if (structureResponse.content && structureResponse.content[0].text.includes('.rocketship/')) { console.log('āœ… Test structure suggestions work'); } else { throw new Error('Test structure suggestions failed'); } console.log('\nāš™ļø Testing schema info...'); const schemaResponse = await server.handleGetSchemaInfo({ section: 'plugins' }); if (schemaResponse.content && schemaResponse.content[0].text.includes('Available Plugins')) { console.log('āœ… Schema info retrieval works'); } else { throw new Error('Schema info retrieval failed'); } console.log('\nāš™ļø Testing codebase analysis with suggested flows...'); const analysisResponse = await server.handleAnalyzeCodebase({ codebase_info: 'React healthcare management system with patient records', focus_area: 'user_journeys', suggested_flows: ['authentication', 'patient-management', 'reporting'] }); if (analysisResponse.content && analysisResponse.content[0].text.includes('Using your suggested flows')) { console.log('āœ… Suggested flows functionality works'); } else { throw new Error('Suggested flows functionality failed'); } console.log('\nāœ… All tests passed! MCP server is ready to use.'); process.exit(0); } catch (error) { console.error(`āŒ Test failed: ${error instanceof Error ? error.message : String(error)}`); if (error instanceof Error) { console.error('Stack trace:', error.stack); } process.exit(1); } } if (require.main === module) { runTests(); } //# sourceMappingURL=test.js.map