@rocketshipai/mcp-server
Version:
MCP assistant for helping AI coding agents write better Rocketship tests
73 lines ⢠3.08 kB
JavaScript
;
/**
* 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