We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jedarden/yt-transcript-dl-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
run-esm-tests.shβ’2.18 KiB
#!/bin/bash
# Script to run ESM migration tests
# This script tests the ESM migration implementation
set -e
echo "π Running ESM Migration Tests"
echo "================================="
# Check if we're in the right directory
if [ ! -f "package.json" ]; then
echo "β Error: Must be run from project root"
exit 1
fi
# Build the project first
echo "π¦ Building project..."
npm run build
# Check if build was successful
if [ ! -f "dist/bin/server.js" ]; then
echo "β Error: Build failed - binary not found"
exit 1
fi
# Run ESM-specific tests
echo "π§ͺ Running ESM migration tests..."
# Use the ESM Jest configuration
npx jest --config=tests/esm-migration/jest.esm.config.js --verbose
# Run a quick smoke test of the binary
echo "π₯ Running binary smoke test..."
# Test help command
echo "Testing --help command..."
timeout 10s node dist/bin/server.js --help || {
echo "β Error: Binary help command failed"
exit 1
}
# Test that binary doesn't have ERR_REQUIRE_ESM
echo "Testing for ERR_REQUIRE_ESM error..."
output=$(timeout 5s node dist/bin/server.js --help 2>&1 || true)
if echo "$output" | grep -q "ERR_REQUIRE_ESM"; then
echo "β Error: ERR_REQUIRE_ESM found in output:"
echo "$output"
exit 1
fi
echo "β Binary smoke test passed"
# Test basic server start (with timeout)
echo "Testing server startup..."
timeout 5s node dist/bin/server.js start --transport stdio 2>&1 | head -n 10 || {
# This may timeout, which is expected
true
}
# Check for successful ESM loading
echo "Testing ESM module loading..."
node -e "
import('./dist/index.js').then(() => {
console.log('β ESM module loading successful');
process.exit(0);
}).catch((error) => {
console.error('β ESM module loading failed:', error.message);
process.exit(1);
});
" || {
echo "β Error: ESM module loading failed"
exit 1
}
echo ""
echo "π All ESM migration tests passed!"
echo "β Binary execution works without ERR_REQUIRE_ESM"
echo "β Import statements resolve correctly"
echo "β MCP SDK compatibility maintained"
echo "β CLI functionality preserved"
echo "β Transport integration working"
echo ""
echo "The ESM migration is ready for implementation!"