MCPcopy
hub / github.com/vitejs/vite / fetchStatusFromPage

Function fetchStatusFromPage

playground/fs-serve/__tests__/commonTests.ts:341–350  ·  view source on GitHub ↗
(page: Page, url: string)

Source from the content-addressed store, hash-verified

339
340describe('cross origin', () => {
341 const fetchStatusFromPage = async (page: Page, url: string) => {
342 return await page.evaluate(async (url: string) => {
343 try {
344 const res = await globalThis.fetch(url)
345 return res.status
346 } catch {
347 return -1
348 }
349 }, url)
350 }
351
352 const connectWebSocketFromPage = async (page: Page, url: string) => {
353 return await page.evaluate(async (url: string) => {

Callers 1

commonTests.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected