helpyourneighbour/backend/scripts/integration-test.mjs

24 lines
675 B
JavaScript
Raw Normal View History

// Einfacher HTTP-Test ohne Playwright
// Funktion zum Senden einer HTTP-Anfrage
async function testHealthEndpoint() {
try {
const response = await fetch('http://localhost:3000/health');
if (response.status === 200) {
console.log('Integration test passed: API server is running and healthy');
return true;
} else {
console.error(`Integration test failed: Expected status 200, got ${response.status}`);
return false;
}
} catch (error) {
console.error('Integration test failed:', error.message);
return false;
}
}
// Führe den Test aus
testHealthEndpoint().then(success => {
if (!success) {
process.exit(1);
}
});