Spaces:
Sleeping
Sleeping
Download apps/api/src/scraper/WebScraper/__tests__/dns.test.ts from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 449 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/scraper/WebScraper/__tests__/dns.test.ts
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/api/src/scraper/WebScraper/__tests__/dns.test.ts
-
curl -L -o dns.test.ts https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/scraper/WebScraper/__tests__/dns.test.ts
449 Bytes
| import CacheableLookup from "cacheable-lookup"; | |
| import https from "node:https"; | |
| import axios from "axios"; | |
| describe("DNS", () => { | |
| it("cached dns", async () => { | |
| const cachedDns = new CacheableLookup(); | |
| cachedDns.install(https.globalAgent); | |
| jest.spyOn(cachedDns, "lookupAsync"); | |
| const res = await axios.get("https://example.com"); | |
| expect(res.status).toBe(200); | |
| expect(cachedDns.lookupAsync).toHaveBeenCalled(); | |
| }); | |
| }); | |