mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
fix: update evaluator tests to match latest implementation
Co-Authored-By: Han Xiao <han.xiao@jina.ai>
This commit is contained in:
@@ -26,22 +26,23 @@ describe('evaluateAnswer', () => {
|
|||||||
const { response } = await evaluateAnswer(
|
const { response } = await evaluateAnswer(
|
||||||
'What is TypeScript?',
|
'What is TypeScript?',
|
||||||
'TypeScript is a strongly typed programming language that builds on JavaScript.',
|
'TypeScript is a strongly typed programming language that builds on JavaScript.',
|
||||||
|
['definitive'],
|
||||||
tokenTracker
|
tokenTracker
|
||||||
);
|
);
|
||||||
expect(response).toHaveProperty('is_definitive');
|
expect(response).toHaveProperty('pass');
|
||||||
expect(response).toHaveProperty('reasoning');
|
expect(response).toHaveProperty('think');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should track token usage', async () => {
|
it('should track token usage', async () => {
|
||||||
const tokenTracker = new TokenTracker();
|
const tokenTracker = new TokenTracker();
|
||||||
const spy = jest.spyOn(tokenTracker, 'trackUsage');
|
const spy = jest.spyOn(tokenTracker, 'trackUsage');
|
||||||
const { tokens } = await evaluateAnswer(
|
await evaluateAnswer(
|
||||||
'What is TypeScript?',
|
'What is TypeScript?',
|
||||||
'TypeScript is a strongly typed programming language that builds on JavaScript.',
|
'TypeScript is a strongly typed programming language that builds on JavaScript.',
|
||||||
|
['definitive'],
|
||||||
tokenTracker
|
tokenTracker
|
||||||
);
|
);
|
||||||
expect(spy).toHaveBeenCalledWith('evaluator', tokens);
|
expect(spy).toHaveBeenCalledWith('evaluator', expect.any(Number));
|
||||||
expect(tokens).toBeGreaterThan(0);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user