From a7c752a6affff6b84cb766d6eff5ab3e9a1240dd Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 16:43:15 +0000 Subject: [PATCH] fix(test): mock wire event in webtorrent regression test Simulates a 'wire' event in MockWebTorrent when a webseed is present, ensuring probePeers correctly identifies the stream as healthy. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- tests/webtorrent-regression.test.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/webtorrent-regression.test.mjs b/tests/webtorrent-regression.test.mjs index 737d896b..dfa329b9 100644 --- a/tests/webtorrent-regression.test.mjs +++ b/tests/webtorrent-regression.test.mjs @@ -19,6 +19,11 @@ class MockWebTorrent extends EventEmitter { setTimeout(() => { if (typeof cb === 'function') cb(torrent); this.emit('torrent', torrent); + + // Simulate webseed connection if urlList is present + if (opts && Array.isArray(opts.urlList) && opts.urlList.length > 0) { + torrent.emit('wire', { type: 'webSeed' }); + } }, 10); return torrent;