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(
|
||||
'What is TypeScript?',
|
||||
'TypeScript is a strongly typed programming language that builds on JavaScript.',
|
||||
['definitive'],
|
||||
tokenTracker
|
||||
);
|
||||
expect(response).toHaveProperty('is_definitive');
|
||||
expect(response).toHaveProperty('reasoning');
|
||||
expect(response).toHaveProperty('pass');
|
||||
expect(response).toHaveProperty('think');
|
||||
});
|
||||
|
||||
it('should track token usage', async () => {
|
||||
const tokenTracker = new TokenTracker();
|
||||
const spy = jest.spyOn(tokenTracker, 'trackUsage');
|
||||
const { tokens } = await evaluateAnswer(
|
||||
await evaluateAnswer(
|
||||
'What is TypeScript?',
|
||||
'TypeScript is a strongly typed programming language that builds on JavaScript.',
|
||||
['definitive'],
|
||||
tokenTracker
|
||||
);
|
||||
expect(spy).toHaveBeenCalledWith('evaluator', tokens);
|
||||
expect(tokens).toBeGreaterThan(0);
|
||||
expect(spy).toHaveBeenCalledWith('evaluator', expect.any(Number));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user