forked from wangziqi/gongxue-base
fix: 修复后端 CI 检查与测试
This commit is contained in:
@@ -8,6 +8,16 @@ import {
|
||||
randomBytes,
|
||||
} from 'node:crypto';
|
||||
|
||||
jest.mock('node:dns', () => ({
|
||||
lookup: jest.fn(
|
||||
(
|
||||
_hostname: string,
|
||||
_options: unknown,
|
||||
callback: (error: null, addresses: Array<{ address: string; family: number }>) => void,
|
||||
) => callback(null, [{ address: '203.0.113.10', family: 4 }]),
|
||||
),
|
||||
}));
|
||||
|
||||
import { AiConfigService } from './ai-config.service';
|
||||
import { AiConfig, AiProvider, SINGLETON_KEY } from './ai-config.entity';
|
||||
|
||||
@@ -105,6 +115,8 @@ describe('AiConfigService', () => {
|
||||
afterEach(() => {
|
||||
delete process.env.AI_CONFIG_ENCRYPTION_KEY;
|
||||
delete process.env.AI_API_KEY;
|
||||
delete process.env.AI_ALLOW_PRIVATE_BASE_URL;
|
||||
delete process.env.NODE_ENV;
|
||||
});
|
||||
|
||||
// ── Encryption ────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user