mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 20:21:36 +00:00
test: speed up testClientUpdate() test
This commit is contained in:
parent
1424a00c3a
commit
63d24611ec
@ -119,14 +119,14 @@ function testClientUpdate (t, serverType) {
|
|||||||
client.on('error', function (err) { t.error(err) })
|
client.on('error', function (err) { t.error(err) })
|
||||||
client.on('warning', function (err) { t.error(err) })
|
client.on('warning', function (err) { t.error(err) })
|
||||||
|
|
||||||
client.setInterval(2000)
|
client.setInterval(500)
|
||||||
|
|
||||||
client.start()
|
client.start()
|
||||||
|
|
||||||
client.once('update', function () {
|
client.once('update', function () {
|
||||||
client.setInterval(2000)
|
client.setInterval(500)
|
||||||
|
|
||||||
// after interval (2s), we should get another update
|
// after interval, 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