WIP
This commit is contained in:
35
backend/tests/test-routes-simple.js
Normal file
35
backend/tests/test-routes-simple.js
Normal file
@ -0,0 +1,35 @@
|
||||
// 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);
|
||||
}
|
||||
Reference in New Issue
Block a user