Updates
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
require('bare-process/global')
|
||||
const test = require('brittle')
|
||||
const { HyperP2PPeerBootstrapStore, PROTOCOL } = require('../index.js')
|
||||
|
||||
test('exports load', (t) => {
|
||||
test('exports', (t) => {
|
||||
t.ok(HyperP2PPeerBootstrapStore)
|
||||
t.is(PROTOCOL, 'peer-bootstrap-store/v1')
|
||||
t.ok(PROTOCOL)
|
||||
})
|
||||
|
||||
test('getStats shape', async (t) => {
|
||||
test('basic operation', async (t) => {
|
||||
const m = new HyperP2PPeerBootstrapStore()
|
||||
const s = m.getStats()
|
||||
t.is(s.tier, 'scaffold')
|
||||
t.is(s.protocol, 'peer-bootstrap-store/v1')
|
||||
m.put('k', 1); t.is(m.get('k'), 1)
|
||||
await m.close()
|
||||
})
|
||||
|
||||
test('validation', async (t) => {
|
||||
const m = new HyperP2PPeerBootstrapStore()
|
||||
try { m.put(null, 1) } catch (e) { t.ok(e) }
|
||||
await m.close()
|
||||
})
|
||||
|
||||
test('getStats', async (t) => {
|
||||
const m = new HyperP2PPeerBootstrapStore()
|
||||
t.ok(m.getStats().protocol)
|
||||
await m.close()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user