mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 10:56:25 +00:00
test: speed up
This commit is contained in:
parent
f575cfc3c9
commit
d759456d7a
@ -99,7 +99,7 @@ function testClientUpdate (t, serverType) {
|
|||||||
t.plan(4)
|
t.plan(4)
|
||||||
common.createServer(t, serverType, function (server, announceUrl) {
|
common.createServer(t, serverType, function (server, announceUrl) {
|
||||||
parsedTorrent.announce = [ announceUrl ]
|
parsedTorrent.announce = [ announceUrl ]
|
||||||
var client = new Client(peerId1, port, parsedTorrent, { interval: 5000 })
|
var client = new Client(peerId1, port, parsedTorrent, { interval: 2000 })
|
||||||
|
|
||||||
client.on('error', function (err) {
|
client.on('error', function (err) {
|
||||||
t.error(err)
|
t.error(err)
|
||||||
@ -112,6 +112,7 @@ function testClientUpdate (t, serverType) {
|
|||||||
client.start()
|
client.start()
|
||||||
|
|
||||||
client.once('update', function () {
|
client.once('update', function () {
|
||||||
|
// after interval (2s), we should get another update
|
||||||
client.once('update', function (data) {
|
client.once('update', function (data) {
|
||||||
// received an update!
|
// received an update!
|
||||||
t.equal(data.announce, announceUrl)
|
t.equal(data.announce, announceUrl)
|
||||||
|
Loading…
Reference in New Issue
Block a user