35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
// Simple test to verify routes are properly structured
|
|
const express = require('express');
|
|
|
|
console.log('🧪 Testing route imports...');
|
|
|
|
try {
|
|
const authRoutes = require('./src/routes/auth');
|
|
console.log('✅ Auth routes imported successfully');
|
|
|
|
const userRoutes = require('./src/routes/user');
|
|
console.log('✅ User routes imported successfully');
|
|
|
|
// Test that they are Express routers
|
|
if (typeof authRoutes === 'function' && authRoutes.stack) {
|
|
console.log('✅ Auth routes is a valid Express router');
|
|
} else {
|
|
console.log('❌ Auth routes is not a valid Express router');
|
|
}
|
|
|
|
if (typeof userRoutes === 'function' && userRoutes.stack) {
|
|
console.log('✅ User routes is a valid Express router');
|
|
} else {
|
|
console.log('❌ User routes is not a valid Express router');
|
|
}
|
|
|
|
// Test app integration
|
|
const app = require('./src/app');
|
|
console.log('✅ App with routes imported successfully');
|
|
|
|
console.log('\n🎉 All route tests passed!');
|
|
|
|
} catch (error) {
|
|
console.error('❌ Route test failed:', error.message);
|
|
process.exit(1);
|
|
} |