dynamische IP für die vorherige Tests
This commit is contained in:
@@ -1,7 +1,21 @@
|
||||
import axios from "axios";
|
||||
import os from "os"; // Modul zum Ermitteln der IP-Adresse
|
||||
|
||||
// Basis-URL des Servers
|
||||
const BASE_URL = "http://10.10.0.70:3000/api/gisStationsMeasurements";
|
||||
// Dynamische Ermittlung der IP-Adresse des Rechners
|
||||
function getLocalIPAddress() {
|
||||
const interfaces = os.networkInterfaces();
|
||||
for (const name of Object.keys(interfaces)) {
|
||||
for (const iface of interfaces[name]) {
|
||||
if (iface.family === "IPv4" && !iface.internal) {
|
||||
return iface.address; // Rückgabe der IPv4-Adresse
|
||||
}
|
||||
}
|
||||
}
|
||||
return "localhost"; // Fallback zu localhost
|
||||
}
|
||||
|
||||
// Basis-URL dynamisch erstellen
|
||||
const BASE_URL = `http://${getLocalIPAddress()}:3000/api/gisStationsMeasurements`;
|
||||
|
||||
describe("Echte API-Integrationstests für gisStationsMeasurements", () => {
|
||||
// Test 1: Erfolgreiche Anfrage mit gültigen Parametern
|
||||
|
||||
Reference in New Issue
Block a user