(ids: number[])
| 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( |
no test coverage detected