import test from 'brittle' import { readFile } from 'node:fs/promises' import { dirname, join } from 'node:path' import { fileURLToPath } from 'node:url' const __dirname = dirname(fileURLToPath(import.meta.url)) const booterIndex = join(__dirname, 'index.js') const vfsPath = join(__dirname, 'lib/vfs.js') test('booter exposes peer details proc producers', async (t) => { const src = await readFile(booterIndex, 'utf8') t.ok(src.includes('procBareOsPeerDetailsText()'), 'peer details proc producer exists') t.ok(src.includes("['peerDetails', '/proc/bare_os/peer_details.json']"), 'baretop snapshot includes peer details') t.ok(src.includes('remotePublicKey'), 'swarm proc includes full remote public keys') }) test('vfs routes peer_details proc aliases', async (t) => { const src = await readFile(vfsPath, 'utf8') t.ok(src.includes('bare_os_peer_details'), 'peer_details pseudo file handler exists') t.ok(src.includes('peer_details.json'), 'peer_details appears in proc index aliases') })