@@ -3,13 +3,15 @@ var fs = require('fs')
33var parseTorrent = require ( 'parse-torrent' )
44var test = require ( 'tape' )
55
6+ // TODO: add test where tracker doesn't support compact
7+
68var torrent = fs . readFileSync ( __dirname + '/torrents/bitlove-intro.torrent' )
79var parsedTorrent = parseTorrent ( torrent )
810var peerId = new Buffer ( '01234567890123456789' )
911var announceUrl = 'http://t.bitlove.org/announce' // TODO: shouldn't rely on an external server!
1012var port = 6881
1113
12- test ( 'client.start()' , function ( t ) {
14+ test ( 'torrent: client.start()' , function ( t ) {
1315 t . plan ( 4 )
1416
1517 var client = new Client ( peerId , port , parsedTorrent )
@@ -32,7 +34,7 @@ test('client.start()', function (t) {
3234 client . start ( )
3335} )
3436
35- test ( 'client.stop()' , function ( t ) {
37+ test ( 'torrent: client.stop()' , function ( t ) {
3638 t . plan ( 4 )
3739
3840 var client = new Client ( peerId , port , parsedTorrent )
@@ -59,7 +61,7 @@ test('client.stop()', function (t) {
5961 } , 1000 )
6062} )
6163
62- test ( 'client.update()' , function ( t ) {
64+ test ( 'torrent: client.update()' , function ( t ) {
6365 t . plan ( 3 )
6466
6567 var client = new Client ( peerId , port , parsedTorrent , { interval : 5000 } )
@@ -83,7 +85,7 @@ test('client.update()', function (t) {
8385 } )
8486} )
8587
86- test ( 'client.scrape()' , function ( t ) {
88+ test ( 'torrent: client.scrape()' , function ( t ) {
8789 t . plan ( 4 )
8890
8991 var client = new Client ( peerId , port , parsedTorrent )
@@ -101,5 +103,3 @@ test('client.scrape()', function (t) {
101103
102104 client . scrape ( )
103105} )
104-
105- // TODO: add test where tracker doesn't support compact
0 commit comments