MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / assertFetchIsBlocked

Function assertFetchIsBlocked

tests/network_blocking.test.ts:127–143  ·  view source on GitHub ↗
(
  url: string,
  received: string[],
  response: McpResponse,
  context: McpContext,
  args: ParsedArguments,
  message = 'blocked request',
)

Source from the content-addressed store, hash-verified

125}
126
127async function assertFetchIsBlocked(
128 url: string,
129 received: string[],
130 response: McpResponse,
131 context: McpContext,
132 args: ParsedArguments,
133 message = 'blocked request',
134): Promise<void> {
135 const result = await fetchFromPage(url, response, context, args);
136 const path = new URL(url).pathname;
137 assert.deepStrictEqual(
138 received.filter(p => p === path),
139 [],
140 `${message}: the request reached the server`,
141 );
142 assert.strictEqual(result, 'Failed to fetch', message);
143}
144
145async function assertServiceWorkerRequestsAreBlocked(
146 server: TestServer,

Callers 1

Calls 1

fetchFromPageFunction · 0.85

Tested by

no test coverage detected