node-DeepResearch/src/tools/__tests__/brave-search.test.ts
devin-ai-integration[bot] 76f8cd242a
feat: merge types and add tests (#10)
* feat: merge types and add tests

- Merged types.ts and tracker.ts
- Added Jest configuration and setup
- Added comprehensive tests for tools and agent
- Updated package.json with test scripts

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* chore: remove tracker.ts after merging into types.ts

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove sensitive API keys from jest.setup.js

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: improve error handling and test timeouts

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* feat: add token budget enforcement to TokenTracker

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* feat: add github actions workflow for CI and fix remaining issues

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
2025-02-03 18:01:59 +08:00

13 lines
494 B
TypeScript

import { braveSearch } from '../brave-search';
describe('braveSearch', () => {
it('should return search results', async () => {
const { response } = await braveSearch('test query');
expect(response.web.results).toBeDefined();
expect(response.web.results.length).toBeGreaterThan(0);
expect(response.web.results[0]).toHaveProperty('title');
expect(response.web.results[0]).toHaveProperty('url');
expect(response.web.results[0]).toHaveProperty('description');
});
});