refactor remove upstream env dependency (#551)

This commit is contained in:
ekko
2026-05-08 20:46:22 +08:00
committed by GitHub
parent bba4920fee
commit 51fde26797
13 changed files with 90 additions and 165 deletions
+4 -6
View File
@@ -1,12 +1,10 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
// Mock config
vi.mock('../../packages/server/src/config', () => ({
config: { upstream: 'http://127.0.0.1:8642' },
}))
vi.mock('../../packages/server/src/services/gateway-bootstrap', () => ({
getGatewayManagerInstance: () => null,
getGatewayManagerInstance: () => ({
getUpstream: () => 'http://127.0.0.1:8642',
getApiKey: () => null,
}),
}))
// Mock updateUsage so we can assert calls without real DB