Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(app-config): pin the overpass budget against its own constant

Maurice7829043a00cb
diff --git a/server/tests/unit/app-config/derive.test.ts b/server/tests/unit/app-config/derive.test.ts
index 300bc3f33..69ed62c01 100644
--- a/server/tests/unit/app-config/derive.test.ts
+++ b/server/tests/unit/app-config/derive.test.ts
@@ -1,5 +1,7 @@
import { describe, it, expect } from 'vitest';
+import { OVERPASS_TIMEOUT_DEFAULT_MS } from '../../../src/nest/maps/maps.helpers';
+
import {
deriveApp,
deriveHttp,
@@ -215,8 +217,10 @@ describe('deriveIntegrations', () => {
expect(deriveIntegrations({ UNSPLASH_ACCESS_KEY: ' key ' }).unsplashAccessKey).toBe('key');
expect(deriveIntegrations({}).transitApiBase).toBe('https://api.transitous.org');
expect(deriveIntegrations({ TRANSIT_API_URL: 'https://t.example//' }).transitApiBase).toBe('https://t.example');
- expect(deriveIntegrations({}).overpassTimeoutMs).toBe(12000);
- expect(deriveIntegrations({ OVERPASS_TIMEOUT_MS: '-1' }).overpassTimeoutMs).toBe(12000);
+ // Against the constant, not a literal: the client budget is derived from the timeout
+ // the query itself carries, and pinning the number here is how the two drifted apart.
+ expect(deriveIntegrations({}).overpassTimeoutMs).toBe(OVERPASS_TIMEOUT_DEFAULT_MS);
+ expect(deriveIntegrations({ OVERPASS_TIMEOUT_MS: '-1' }).overpassTimeoutMs).toBe(OVERPASS_TIMEOUT_DEFAULT_MS);
});
it('floors the LLM ceiling to a whole number — undici rejects a fractional headersTimeout', () => {