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

Function createPages

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

Source from the content-addressed store, hash-verified

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