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 <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-01 16:43:15 +00:00
1 parent a3cc4a7456
commit a7c752a6af
1 file changed
+5
+5
View File
@@ -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;