#!/usr/bin/env node
/**
* Integration test for the DataMerge MCP package
* Tests the basic flow from MCP client to DataMerge API client
*/
const { DataMergeClient } = require('./dist/datamerge-client.js');
async function testIntegration() {
console.log('š Integration Test: DataMerge MCP Package\n');
try {
// Test 1: Client Creation
console.log('1ļøā£ Testing client creation...');
const client = new DataMergeClient({
apiKey: 'test-api-key-123',
baseUrl: 'https://api.datamerge.ai',
});
console.log(' ā
Client created successfully');
// Test 2: Configuration
console.log('\n2ļøā£ Testing configuration...');
const config = client.getConfig();
console.log(' ā
Config retrieved:', {
baseUrl: config.baseUrl,
hasApiKey: !!config.apiKey,
});
// Test 3: Health Check (this may fail without a real key, but should not crash)
console.log('\n3ļøā£ Testing health check...');
try {
const isHealthy = await client.healthCheck();
console.log(' ā
Health check result:', isHealthy);
} catch (error) {
console.log(' ā ļø Health check failed as expected (no real API key):', error.message);
}
console.log('\nš Integration test completed (client wiring verified)!');
} catch (error) {
console.error('ā Integration test failed:', error);
}
}
// Run integration test
testIntegration();