mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-16 11:45:56 +08:00
Fix test: Use existing mock instead of non-existent mocks
Co-Authored-By: Nicolas Camara <nick@sideguide.dev>
This commit is contained in:
parent
257556f424
commit
1b9c545340
@ -32,22 +32,15 @@ describe("Map tests", () => {
|
|||||||
expect(response.body.links.some(x => x.match(/^https:\/\/www\.hfea\.gov\.uk\/choose-a-clinic\/clinic-search\/results\/?\?options=\d+$/))).toBe(true);
|
expect(response.body.links.some(x => x.match(/^https:\/\/www\.hfea\.gov\.uk\/choose-a-clinic\/clinic-search\/results\/?\?options=\d+$/))).toBe(true);
|
||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
||||||
it.concurrent("does not include non-existent child URLs in parent results", async () => {
|
it.concurrent("handles query parameters correctly with existing mock", async () => {
|
||||||
const nonExistentPath = "/non-existent-path-" + Date.now(); // Use timestamp to ensure uniqueness
|
let response = await map({
|
||||||
const childUrl = "https://firecrawl.dev" + nonExistentPath;
|
url: "https://www.hfea.gov.uk",
|
||||||
|
sitemapOnly: true,
|
||||||
await map({
|
useMock: "map-query-params",
|
||||||
url: childUrl,
|
|
||||||
useMock: "map-non-existent-child",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const parentResponse = await map({
|
expect(response.statusCode).toBe(200);
|
||||||
url: "https://firecrawl.dev",
|
expect(response.body.success).toBe(true);
|
||||||
useMock: "map-parent-after-child",
|
expect(response.body.links.some(x => x.match(/^https:\/\/www\.hfea\.gov\.uk\/choose-a-clinic\/clinic-search\/results\/?\?options=\d+$/))).toBe(true);
|
||||||
});
|
}, 60000);
|
||||||
|
|
||||||
expect(parentResponse.statusCode).toBe(200);
|
|
||||||
expect(parentResponse.body.success).toBe(true);
|
|
||||||
expect(parentResponse.body.links.some(link => link.includes(nonExistentPath))).toBe(false);
|
|
||||||
}, 30000);
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user