import test from 'node:test'; import assert from 'node:assert/strict'; import { readFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; const root = join(dirname(fileURLToPath(import.meta.url)), '..'); test('frontend wiring exposes the playable MVP surfaces', async () => { const html = await readFile(join(root, 'index.html'), 'utf8'); const shared = await readFile(join(root, 'src', 'shared.js'), 'utf8'); for (const label of ['opening-scene', 'opening-video', 'world-viewport', 'reality-deck', 'minimap-viewport', 'agent-list', 'event-feed', 'toolbelt', 'terminal-phone', 'inspector-drawer', 'touch-controls']) { assert.match(html, new RegExp(`id="${label}"`)); } const interfaceText = `${html}\n${shared}`; for (const label of ['Terminal Phone', 'Bash Hammer', 'Git Backpack', 'Docker Box', 'Code Tablet', 'SSH Key', 'Database Vault', 'Deploy Rocket']) { assert.match(interfaceText, new RegExp(label)); } assert.match(html, /SNAPKITTYWEST/); assert.match(html, /SIMULATED REPOSITORY DATA/); assert.match(html, /data-reference-image="NeonReflections\/3090\.webp"/); assert.match(html, /data-action="enter-game"/); }); test('the local app contains no runtime network or external asset dependency', async () => { const files = ['index.html', 'styles.css', 'src/main.ts', 'src/shared.js', 'src/world-architect.js', 'src/ui-reality.js']; const contents = await Promise.all(files.map((file) => readFile(join(root, file), 'utf8'))); const source = contents.join('\n'); assert.doesNotMatch(source, /fetch\s*\(|XMLHttpRequest|WebSocket|https?:\/\//i); assert.doesNotMatch(source, / { const packageJson = JSON.parse(await readFile(join(root, 'package.json'), 'utf8')); assert.equal(packageJson.scripts.test, 'node --test tests/*.test.mjs'); assert.equal(packageJson.scripts.build, 'node scripts/build.mjs'); assert.equal(packageJson.private, true); });