syia-mcp-utils
Version:
Global utility functions for MCP server
38 lines (29 loc) โข 1.01 kB
JavaScript
// Simple script to test getDataLink with your credentials
console.log('๐งช Testing getDataLink function...\n');
// Load test configuration
require('./test/test-config');
// Import the function
const { getDataLink } = require('./dist/helper_functions');
async function testGetDataLink() {
// Test data
const testData = [
{ id: 1, name: 'Test Vessel', imo: 123456789 },
{ id: 2, name: 'Test Vessel 2', imo: 987654321 },
];
try {
console.log('๐ค Sending test data:', JSON.stringify(testData, null, 2));
console.log('โณ Waiting for response...\n');
const result = await getDataLink(testData);
console.log('โ
Test PASSED!');
console.log('๐ฅ Received data link:', result);
console.log('๐ Link length:', result.length);
} catch (error) {
console.error('โ Test FAILED!');
console.error('Error:', error.message);
console.error('Stack:', error.stack);
process.exit(1);
}
}
// Run the test
testGetDataLink();