Updates
This commit is contained in:
@@ -30,10 +30,21 @@ test('cancelBlock', async (t) => {
|
||||
await m.close()
|
||||
})
|
||||
|
||||
test('enqueueMany bumpPriority inflightCount', async (t) => {
|
||||
const m = new HyperP2PCorePriorityFetch()
|
||||
t.is(m.enqueueMany([1, 2, 3], 1), 3)
|
||||
m.dequeue()
|
||||
t.is(m.inflightCount(), 1)
|
||||
m.bumpPriority(2, 99)
|
||||
t.ok(m.peekBlock().index === 2 || m.peekBlock().index === 3)
|
||||
await m.close()
|
||||
})
|
||||
|
||||
test('getStats', async (t) => {
|
||||
const m = new HyperP2PCorePriorityFetch()
|
||||
m.enqueueBlock(0, 0)
|
||||
t.is(m.getStats().pending, 1)
|
||||
t.is(m.getStats().mode, 'hypercore')
|
||||
await m.close()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user