Cross-check el() ids against index.html in the selftest

A knob wired in app.js but missing from the markup throws during wiring, aborts
the module and leaves a blank page - a symptom pointing nowhere near its cause.
It has now happened twice, so it gets a check rather than vigilance: the
selftest fetches both files and compares the id sets in each direction.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Your Name 2026-09-24 15:25:39 -04:00
parent 9a11eeabc1
commit a146d271b6
3 changed files with 38 additions and 2 deletions

View file

@ -7,10 +7,11 @@
</style></head><body>
<h1 id="head">running…</h1><ul id="out"></ul>
<script type="module">
import { run } from './js/selftest.js';
import { run, runWiring } from './js/selftest.js';
let res;
try { res = run(); }
catch (e) { res = [{ name: 'harness threw: ' + e.message, pass: false, detail: String(e.stack).split('\n')[1] || '' }]; }
res = res.concat(await runWiring());
const pass = res.filter(r => r.pass).length;
const fail = res.length - pass;
document.getElementById('head').textContent = `${fail === 0 ? 'PASS' : 'FAIL'} — ${pass}/${res.length} assertions`;