Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Nick: more snips

Nicolas11fea284734f
diff --git a/apps/api/src/__tests__/snips/v2/search.test.ts b/apps/api/src/__tests__/snips/v2/search.test.ts
index 004c0a6ed..c1cb4131c 100644
--- a/apps/api/src/__tests__/snips/v2/search.test.ts
+++ b/apps/api/src/__tests__/snips/v2/search.test.ts
@@ -47,4 +47,56 @@ describe("Search tests", () => {
},
125000,
);
+
+ it.concurrent(
+ "works for news",
+ async () => {
+ const res = await search(
+ {
+ query: "firecrawl",
+ sources: ["news"],
+ },
+ identity,
+ );
+ expect(res.news).toBeDefined();
+ expect(res.news?.length).toBeGreaterThan(0);
+ },
+ 60000,
+ );
+
+ it.concurrent(
+ "works for images",
+ async () => {
+ const res = await search(
+ {
+ query: "firecrawl",
+ sources: ["images"],
+ },
+ identity,
+ );
+ expect(res.images).toBeDefined();
+ expect(res.images?.length).toBeGreaterThan(0);
+ },
+ 60000,
+ );
+
+ it.concurrent(
+ "works for multiple sources",
+ async () => {
+ const res = await search(
+ {
+ query: "firecrawl",
+ sources: ["web", "news", "images"],
+ },
+ identity,
+ );
+ expect(res.web).toBeDefined();
+ expect(res.web?.length).toBeGreaterThan(0);
+ expect(res.news).toBeDefined();
+ expect(res.news?.length).toBeGreaterThan(0);
+ expect(res.images).toBeDefined();
+ expect(res.images?.length).toBeGreaterThan(0);
+ },
+ 60000,
+ );
});