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

Function createPages

tests/ToolHandler.test.ts:804–817  ·  view source on GitHub ↗
(ids: number[])

Source from the content-addressed store, hash-verified

802 }
803
804 function createPages(ids: number[]) {
805 const mockContext = createMockMcpContext();
806 const mockProcess = sinon.createStubInstance(ChildProcess);
807 mockContext.ensureBrowser.resolves(
808 getMockBrowser({process: mockProcess}),
809 );
810 const pages = new Map(ids.map(id => [id, createMockMcpPage({id})]));
811 mockContext.getPageById.callsFake(id => {
812 const page = pages.get(id);
813 assert.ok(page);
814 return page;
815 });
816 return mockContext;
817 }
818
819 function createHandler(tool: AnyToolDefinition, mockContext: McpContext) {
820 return new ToolHandler(

Callers 1

Calls 4

createMockMcpContextFunction · 0.85
getMockBrowserFunction · 0.85
createMockMcpPageFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected