Documentation
    Preparing search index...

    Function createMockTorrentService

    • Create the NAP-TORRENT mock.

      Parameters

      Returns MockTorrentService

      The mock service with an advance() control.

      const torrent = createMockTorrentService();
      const source = { sourceType: 'magnet', magnet: LINUX_DISTROS[0].magnet };
      torrent.handleMessage('win', { type: 'torrent.add', id: 'a1', request: { source } }, console.log);
      torrent.advance(5); // metadata, four progress pushes, then complete