function mockAttachingSession({id, targetType}) {
    const cdpSessionMock = createMockCdpSession(id);
    cdpSessionMock.send
      .mockResponse('Page.enable')
      .mockResponse('Page.getFrameTree', {frameTree: {frame: {id: 'mainFrameId'}}})
      .mockResponse('Runtime.enable')
      .mockResponse('Target.getTargetInfo', {targetInfo: {type: targetType, targetId: id}})
      .mockResponse('Network.enable')
      .mockResponse('Target.setAutoAttach')
      .mockResponse('Runtime.runIfWaitingForDebugger');

    return cdpSessionMock;
  }
Mock a Puppeteer CDPSession, including the commands needed to attach to the
target manager.
@param {{id: string, targetType: 'page'|'iframe'|'other'}} args