Spaces:
Sleeping
Sleeping
Download apps/api/src/services/webhook/delivery.test.ts from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 905 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/services/webhook/delivery.test.ts
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/api/src/services/webhook/delivery.test.ts
-
curl -L -o delivery.test.ts https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/services/webhook/delivery.test.ts
905 Bytes
| import { WebhookEvent } from "./types"; | |
| import { webhookEventMatchesFilter } from "./delivery"; | |
| describe("webhook delivery", () => { | |
| describe("webhookEventMatchesFilter", () => { | |
| it("matches full monitor event names", () => { | |
| expect( | |
| webhookEventMatchesFilter( | |
| ["monitor.page", "monitor.check.completed"], | |
| WebhookEvent.MONITOR_PAGE, | |
| ), | |
| ).toBe(true); | |
| expect( | |
| webhookEventMatchesFilter( | |
| ["monitor.page", "monitor.check.completed"], | |
| WebhookEvent.MONITOR_CHECK_COMPLETED, | |
| ), | |
| ).toBe(true); | |
| }); | |
| it("keeps legacy subtype filters for non-monitor webhooks", () => { | |
| expect(webhookEventMatchesFilter(["page"], WebhookEvent.CRAWL_PAGE)).toBe( | |
| true, | |
| ); | |
| expect( | |
| webhookEventMatchesFilter(["completed"], WebhookEvent.CRAWL_COMPLETED), | |
| ).toBe(true); | |
| }); | |
| }); | |
| }); | |