This commit is contained in:
Raven Scott
2026-05-20 21:57:50 -04:00
parent c5d54be3ca
commit 341542f41b
426 changed files with 18651 additions and 3519 deletions
@@ -1,14 +1,26 @@
require('bare-process/global')
const test = require('brittle')
const { HyperP2PBareDistributableHint, PROTOCOL } = require('../index.js')
test('exports load', (t) => {
test('exports', (t) => {
t.ok(HyperP2PBareDistributableHint)
t.is(PROTOCOL, 'bare-distributable-hint/v1')
t.ok(PROTOCOL)
})
test('getStats shape', async (t) => {
test('basic operation', async (t) => {
const m = new HyperP2PBareDistributableHint()
const s = m.getStats()
t.is(s.tier, 'scaffold')
t.is(s.protocol, 'bare-distributable-hint/v1')
m.put('k', 1); t.is(m.get('k'), 1)
await m.close()
})
test('validation', async (t) => {
const m = new HyperP2PBareDistributableHint()
try { m.put(null, 1) } catch (e) { t.ok(e) }
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PBareDistributableHint()
t.ok(m.getStats().protocol)
await m.close()
})