From fe297142dadeda925ae0bd709ae2d42fa869d808 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Tue, 28 Apr 2026 14:34:27 -0400 Subject: [PATCH] test(cliproxy): isolate routing HTTP module test --- tests/unit/cliproxy/routing-strategy-http.test.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/unit/cliproxy/routing-strategy-http.test.ts b/tests/unit/cliproxy/routing-strategy-http.test.ts index 6a3e9463..c3edf31d 100644 --- a/tests/unit/cliproxy/routing-strategy-http.test.ts +++ b/tests/unit/cliproxy/routing-strategy-http.test.ts @@ -1,9 +1,15 @@ import { describe, expect, it } from 'bun:test'; -import { getCliproxyRoutingManagementUrl } from '../../../src/cliproxy/routing-strategy-http'; import type { ProxyTarget } from '../../../src/cliproxy/proxy-target-resolver'; +async function loadRoutingHttpModule() { + return import( + `../../../src/cliproxy/routing-strategy-http?test=${Date.now()}-${Math.random()}` + ) as Promise; +} + describe('routing-strategy-http', () => { - it('builds the local management URL for routing strategy reads', () => { + it('builds the local management URL for routing strategy reads', async () => { + const { getCliproxyRoutingManagementUrl } = await loadRoutingHttpModule(); const target: ProxyTarget = { host: '127.0.0.1', port: 8317, @@ -16,7 +22,8 @@ describe('routing-strategy-http', () => { ); }); - it('builds the remote management URL for routing strategy writes', () => { + it('builds the remote management URL for routing strategy writes', async () => { + const { getCliproxyRoutingManagementUrl } = await loadRoutingHttpModule(); const target: ProxyTarget = { host: 'proxy.example.com', port: 443,