fix(tests): fix tests

This commit is contained in:
Juergen Kunz
2025-06-23 08:38:14 +00:00
parent 1aead55296
commit be58700a2f
14 changed files with 153 additions and 107 deletions

View File

@ -159,11 +159,11 @@ tap.test('should extract path parameters from URL', async () => {
// Test multiple configs for same hostname with different paths
tap.test('should support multiple configs for same hostname with different paths', async () => {
const apiConfig = createRouteConfig(TEST_DOMAIN, '10.0.0.1', 8001);
apiConfig.match.path = '/api';
apiConfig.match.path = '/api/*';
apiConfig.name = 'api-route';
const webConfig = createRouteConfig(TEST_DOMAIN, '10.0.0.2', 8002);
webConfig.match.path = '/web';
webConfig.match.path = '/web/*';
webConfig.name = 'web-route';
// Add both configs
@ -252,7 +252,7 @@ tap.test('should fall back to default configuration', async () => {
const defaultConfig = createRouteConfig('*');
const specificConfig = createRouteConfig(TEST_DOMAIN);
router.setRoutes([defaultConfig, specificConfig]);
router.setRoutes([specificConfig, defaultConfig]);
// Test specific domain routes to specific config
const specificReq = createMockRequest(TEST_DOMAIN);
@ -272,7 +272,7 @@ tap.test('should prioritize exact hostname over wildcard', async () => {
const wildcardConfig = createRouteConfig(TEST_WILDCARD);
const exactConfig = createRouteConfig(TEST_SUBDOMAIN);
router.setRoutes([wildcardConfig, exactConfig]);
router.setRoutes([exactConfig, wildcardConfig]);
// Test that exact match takes priority
const req = createMockRequest(TEST_SUBDOMAIN);