mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-11 18:59:01 +08:00
Update index.test.ts
This commit is contained in:
parent
837b446390
commit
7ae195bacc
@ -149,7 +149,7 @@ describe("E2E Tests for API Routes", () => {
|
|||||||
expect(response.body.data).toHaveProperty("metadata");
|
expect(response.body.data).toHaveProperty("metadata");
|
||||||
expect(response.body.data.content).toContain("_Roast_");
|
expect(response.body.data.content).toContain("_Roast_");
|
||||||
expect(response.body.data.markdown).toContain("_Roast_");
|
expect(response.body.data.markdown).toContain("_Roast_");
|
||||||
expect(response.body.data.html).toContain("<h1");
|
expect(response.body.data.rawHtml).toContain("<h1");
|
||||||
expect(response.body.data.metadata.pageStatusCode).toBe(200);
|
expect(response.body.data.metadata.pageStatusCode).toBe(200);
|
||||||
expect(response.body.data.metadata.pageError).toBeUndefined();
|
expect(response.body.data.metadata.pageError).toBeUndefined();
|
||||||
}, 30000); // 30 seconds timeout
|
}, 30000); // 30 seconds timeout
|
||||||
@ -1211,21 +1211,18 @@ describe("E2E Tests for API Routes", () => {
|
|||||||
extractorOptions: {
|
extractorOptions: {
|
||||||
mode: "llm-extraction-from-raw-html",
|
mode: "llm-extraction-from-raw-html",
|
||||||
extractionPrompt:
|
extractionPrompt:
|
||||||
"Based on the information on the page, find what the company's mission is and whether it supports SSO, and whether it is open source",
|
"Based on the information on the page, what are the primary and secondary CTA buttons?",
|
||||||
extractionSchema: {
|
extractionSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
company_mission: {
|
primary_cta: {
|
||||||
type: "string",
|
type: "string",
|
||||||
},
|
},
|
||||||
supports_sso: {
|
secondary_cta: {
|
||||||
type: "boolean",
|
type: "string",
|
||||||
},
|
|
||||||
is_open_source: {
|
|
||||||
type: "boolean",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ["company_mission", "supports_sso", "is_open_source"],
|
required: ["primary_cta", "secondary_cta"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -1237,14 +1234,11 @@ describe("E2E Tests for API Routes", () => {
|
|||||||
let llmExtraction = response.body.data.llm_extraction;
|
let llmExtraction = response.body.data.llm_extraction;
|
||||||
|
|
||||||
// Check if the llm_extraction object has the required properties with correct types and values
|
// Check if the llm_extraction object has the required properties with correct types and values
|
||||||
expect(llmExtraction).toHaveProperty("company_mission");
|
expect(llmExtraction).toHaveProperty("primary_cta");
|
||||||
expect(typeof llmExtraction.company_mission).toBe("string");
|
expect(typeof llmExtraction.primary_cta).toBe("string");
|
||||||
expect(llmExtraction).toHaveProperty("supports_sso");
|
expect(llmExtraction).toHaveProperty("secondary_cta");
|
||||||
expect(llmExtraction.supports_sso).toBe(true);
|
expect(typeof llmExtraction.secondary_cta).toBe("string");
|
||||||
expect(typeof llmExtraction.supports_sso).toBe("boolean");
|
|
||||||
expect(llmExtraction).toHaveProperty("is_open_source");
|
|
||||||
expect(llmExtraction.is_open_source).toBe(false);
|
|
||||||
expect(typeof llmExtraction.is_open_source).toBe("boolean");
|
|
||||||
}, 60000); // 60 secs
|
}, 60000); // 60 secs
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user