defect-inspection-tools-mcp-server
Version:
Defect inspection tools server handling defect detection, analysis, and reporting with AI/ML capabilities for quality control
46 lines (37 loc) โข 1.29 kB
JavaScript
import { spawn } from 'child_process';
console.log('๐งช Testing Defect Inspection Tools MCP Server...\n');
const testCommands = [
'node dist/index.js --help',
'echo "Server help command test completed"'
];
async function runTests() {
for (const command of testCommands) {
console.log(`Running: ${command}`);
const [cmd, ...args] = command.split(' ');
const child = spawn(cmd, args, {
stdio: 'inherit',
shell: true
});
await new Promise((resolve, reject) => {
child.on('exit', (code) => {
if (code === 0) {
console.log('โ
Test passed\n');
resolve();
} else {
console.log('โ Test failed\n');
reject(new Error(`Command failed with code ${code}`));
}
});
child.on('error', (error) => {
console.log('โ Test failed with error:', error.message);
reject(error);
});
});
}
console.log('๐ All tests completed!');
}
runTests().catch((error) => {
console.error('Test suite failed:', error.message);
process.exit(1);
});