fix: resolve linting issues in test files

Co-Authored-By: Han Xiao <han.xiao@jina.ai>
This commit is contained in:
Devin AI 2025-02-05 10:01:45 +00:00
parent 3e08ae1c7a
commit 5473ce254b
5 changed files with 6 additions and 11 deletions

View File

@ -1,5 +1,4 @@
import { GoogleAIWrapper, LocalLLMClient } from '../utils/llm-client';
import * as config from '../config';
describe('LLM Client', () => {
const originalEnv = process.env;
@ -13,19 +12,19 @@ describe('LLM Client', () => {
process.env = originalEnv;
});
it('should use GoogleAIWrapper by default', () => {
it('should use GoogleAIWrapper by default', async () => {
process.env.LLM_PROVIDER = 'gemini';
process.env.GEMINI_API_KEY = 'test-key';
const { llmClient } = require('../config');
expect(llmClient).toBeInstanceOf(GoogleAIWrapper);
const config = await import('../config');
expect(config.llmClient).toBeInstanceOf(GoogleAIWrapper);
});
it('should use LocalLLMClient when configured', () => {
it('should use LocalLLMClient when configured', async () => {
process.env.LLM_PROVIDER = 'local';
process.env.LOCAL_LLM_HOSTNAME = 'localhost';
process.env.LOCAL_LLM_PORT = '8000';
process.env.LOCAL_LLM_MODEL = 'test-model';
const { llmClient } = require('../config');
expect(llmClient).toBeInstanceOf(LocalLLMClient);
const config = await import('../config');
expect(config.llmClient).toBeInstanceOf(LocalLLMClient);
});
});

View File

@ -1,7 +1,6 @@
import { dedupQueries } from '../dedup';
import { MockLLMClient } from './utils/llm-mock';
import { TEST_RESPONSES } from './utils/test-config';
import * as config from '../../config';
jest.mock('../../config', () => ({
...jest.requireActual('../../config'),

View File

@ -1,7 +1,6 @@
import { analyzeSteps } from '../error-analyzer';
import { MockLLMClient } from './utils/llm-mock';
import { TEST_RESPONSES } from './utils/test-config';
import * as config from '../../config';
jest.mock('../../config', () => ({
...jest.requireActual('../../config'),

View File

@ -2,7 +2,6 @@ import { evaluateAnswer } from '../evaluator';
import { TokenTracker } from '../../utils/token-tracker';
import { MockLLMClient } from './utils/llm-mock';
import { TEST_RESPONSES } from './utils/test-config';
import * as config from '../../config';
jest.mock('../../config', () => ({
...jest.requireActual('../../config'),

View File

@ -1,7 +1,6 @@
import { rewriteQuery } from '../query-rewriter';
import { MockLLMClient } from './utils/llm-mock';
import { TEST_RESPONSES } from './utils/test-config';
import * as config from '../../config';
jest.mock('../../config', () => ({
...jest.requireActual('../../config'),