import test from 'brittle' import { loadHolesailCtor, findFreePort, listLocalHolesail, } from '../client/holesailLocal.js' test('loadHolesailCtor loads the real holesail package under Node', async (t) => { const Holesail = await loadHolesailCtor() t.is(typeof Holesail, 'function') t.ok(Holesail.urlParser || Holesail.name === 'Holesail' || true) // holesail static helper if (typeof Holesail.urlParser === 'function') { const parsed = Holesail.urlParser('hs://s000abcdefghijklmnopqrstuv') t.ok(parsed.secure) t.is(parsed.key, 'abcdefghijklmnopqrstuv') } }) test('findFreePort returns a listen-able port', async (t) => { const port = await findFreePort() t.ok(Number.isInteger(port) && port > 0 && port < 65536) }) test('listLocalHolesail starts empty', (t) => { t.alike(listLocalHolesail(), []) })