mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: resolve linting issues in test files
Co-Authored-By: Han Xiao <han.xiao@jina.ai>
This commit is contained in:
parent
3e08ae1c7a
commit
5473ce254b
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@ -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'),
|
||||
|
||||
@ -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'),
|
||||
|
||||
@ -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'),
|
||||
|
||||
@ -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'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user