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>
21 lines
1.1 KiB
HTML
21 lines
1.1 KiB
HTML
<!doctype html>
|
|
<html lang="en"><head><meta charset="utf-8"><title>selftest</title>
|
|
<style>
|
|
body{background:#0b0d13;color:#e8eaf0;font:13px/1.6 ui-monospace,Menlo,monospace;padding:20px}
|
|
li{list-style:none} .p{color:#4ade80} .f{color:#f87171}
|
|
b{font-weight:400;color:#8891a5} h1{font-size:14px}
|
|
</style></head><body>
|
|
<h1 id="head">running…</h1><ul id="out"></ul>
|
|
<script type="module">
|
|
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`;
|
|
document.title = `${fail === 0 ? 'PASS' : 'FAIL'} ${pass}/${res.length}`;
|
|
document.getElementById('out').innerHTML = res.map(r =>
|
|
`<li class="${r.pass ? 'p' : 'f'}">${r.pass ? '✓' : '✗'} ${r.name}${r.detail ? ` <b>${r.detail}</b>` : ''}</li>`).join('');
|
|
</script></body></html>
|