fix(strcuture): refactor responsibilities
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
||||
import { SmartProxy } from '../ts/index.js';
|
||||
import * as plugins from '../ts/plugins.js';
|
||||
|
||||
/**
|
||||
* Test that verifies ACME challenge routes are properly created
|
||||
@ -22,22 +23,23 @@ tap.test('should create ACME challenge route with high ports', async (tools) =>
|
||||
target: { host: 'localhost', port: 8080 },
|
||||
tls: {
|
||||
mode: 'terminate' as const,
|
||||
certificate: 'auto'
|
||||
certificate: 'auto' as const
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
acme: {
|
||||
email: 'test@test.local',
|
||||
port: 18080 // High port for ACME challenges
|
||||
email: 'test@example.com',
|
||||
port: 18080, // High port for ACME challenges
|
||||
useProduction: false // Use staging environment
|
||||
}
|
||||
};
|
||||
|
||||
const proxy = new SmartProxy(settings);
|
||||
|
||||
// Capture route updates
|
||||
const originalUpdateRoutes = (proxy as any).updateRoutesInternal.bind(proxy);
|
||||
(proxy as any).updateRoutesInternal = async function(routes: any[]) {
|
||||
const originalUpdateRoutes = (proxy as any).updateRoutes.bind(proxy);
|
||||
(proxy as any).updateRoutes = async function(routes: any[]) {
|
||||
capturedRoutes.push([...routes]);
|
||||
return originalUpdateRoutes(routes);
|
||||
};
|
||||
|
Reference in New Issue
Block a user