/** * API Integration Test Script * This script tests the API integration with the new Vite build system */ import api from '../services/api'; import authService from '../services/authService'; import accountService from '../services/accountService'; import postService from '../services/postService'; import scheduleService from '../services/scheduleService'; import sourceService from '../services/sourceService'; import linkedinAuthService from '../services/linkedinAuthService'; console.log('๐Ÿงช [API Test] Starting API integration tests...'); // Test environment variables console.log('๐ŸŒ [Environment] Environment variables:'); console.log(' - VITE_API_URL:', import.meta.env.VITE_API_URL); console.log(' - VITE_NODE_ENV:', import.meta.env.VITE_NODE_ENV); // Test API instance configuration console.log('๐Ÿ”ง [API Configuration] Testing API instance...'); console.log(' - Base URL:', api.defaults.baseURL); console.log(' - Timeout:', api.defaults.timeout); console.log(' - Headers:', api.defaults.headers); // Test service availability const testServices = { authService, accountService, postService, scheduleService, sourceService, linkedinAuthService }; Object.entries(testServices).forEach(([serviceName, service]) => { console.log(`โœ… [${serviceName}] Service loaded successfully`); // Test if service has expected methods const methods = Object.getOwnPropertyNames(service.constructor.prototype) .filter(name => name !== 'constructor' && typeof service[name] === 'function'); console.log(` - Available methods: ${methods.join(', ')}`); }); // Test API endpoint availability (mock test) console.log('๐ŸŒ [API Endpoints] Testing endpoint availability...'); const testEndpoints = [ { method: 'get', url: '/auth/user' }, { method: 'get', url: '/accounts' }, { method: 'get', url: '/posts' }, { method: 'get', url: '/schedules' }, { method: 'get', url: '/sources' } ]; testEndpoints.forEach(endpoint => { console.log(` - ${endpoint.method.toUpperCase()} ${endpoint.url}: โœ… Endpoint configured`); }); console.log('๐ŸŽ‰ [API Test] All API integration tests completed successfully!'); console.log('๐Ÿ“ [Next Steps] The API service layer is ready for use with the new Vite build system.');