| 511 | }) |
| 512 | |
| 513 | function testUnsupportedTracker (t, announceUrl) { |
| 514 | t.plan(1) |
| 515 | |
| 516 | const client = new Client({ |
| 517 | infoHash: fixtures.leaves.parsedTorrent.infoHash, |
| 518 | announce: announceUrl, |
| 519 | peerId: peerId1, |
| 520 | port, |
| 521 | wrtc: {} |
| 522 | }) |
| 523 | |
| 524 | client.on('error', err => { t.error(err) }) |
| 525 | client.on('warning', err => { |
| 526 | t.ok(err.message.includes('tracker'), 'got warning') |
| 527 | |
| 528 | client.destroy() |
| 529 | }) |
| 530 | } |
| 531 | |
| 532 | test('unsupported tracker protocol', t => { |
| 533 | testUnsupportedTracker(t, 'badprotocol://127.0.0.1:8080/announce') |