// @vitest-environment happy-dom import { readFileSync } from 'node:fs'; import { resolve } from 'node:path'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { boot, STARTUP_TEXT, type Booted } from '../../apps/even-client/src/boot.ts'; import { HOST_WAIT_MS } from '../../apps/even-client/src/device/hostDetect.ts'; /** * CODY-014, at the rendered-page seam: the real index.html markup, the real boot() that main.ts * calls, the real Even Hub SDK bridge, in a DOM (happy-dom). The Even app host is a stand-in * object providing `flutter_inappwebview.callHandler`; it is not the Even app and not glasses. */ // Resolved from the repository root (vitest's working directory): in this DOM environment // `import.meta.url` is not a file URL. const indexHtml = readFileSync(resolve(process.cwd(), 'apps/even-client/index.html'), 'utf8'); const bodyHtml = /
([\s\S]*)<\/body>/.exec(indexHtml)![1]!.replace(/