Spaces:
Sleeping
Sleeping
Download apps/api/src/scraper/scrapeURL/__tests__/shouldCheckRobots.test.ts from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/scraper/scrapeURL/__tests__/shouldCheckRobots.test.ts
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/api/src/scraper/scrapeURL/__tests__/shouldCheckRobots.test.ts
-
curl -L -o shouldCheckRobots.test.ts https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/scraper/scrapeURL/__tests__/shouldCheckRobots.test.ts
1.06 kB
| import { shouldCheckRobots } from "../shouldCheckRobots"; | |
| describe("shouldCheckRobots", () => { | |
| it("returns false when lockdown is true, even if the team flag is set", () => { | |
| expect( | |
| shouldCheckRobots( | |
| { lockdown: true }, | |
| { teamFlags: { checkRobotsOnScrape: true } as any }, | |
| ), | |
| ).toBe(false); | |
| }); | |
| it("returns false when the team flag is off, regardless of lockdown", () => { | |
| expect( | |
| shouldCheckRobots( | |
| { lockdown: false }, | |
| { teamFlags: { checkRobotsOnScrape: false } as any }, | |
| ), | |
| ).toBe(false); | |
| expect( | |
| shouldCheckRobots({ lockdown: true }, { teamFlags: {} as any }), | |
| ).toBe(false); | |
| }); | |
| it("returns false when teamFlags is missing", () => { | |
| expect(shouldCheckRobots({ lockdown: false }, {})).toBe(false); | |
| }); | |
| it("returns true only when the team flag is on and lockdown is off", () => { | |
| expect( | |
| shouldCheckRobots( | |
| { lockdown: false }, | |
| { teamFlags: { checkRobotsOnScrape: true } as any }, | |
| ), | |
| ).toBe(true); | |
| }); | |
| }); | |