The tests run the simulator's physiological model (hovorka.js + simulator.js)
directly in the browser — without UI, graph or game mechanics. A minimal mock environment replaces DOM elements
so the model can be initialized.
Each test creates a fresh Simulator instance with a given profile (weight, ISF, ICR).
Starting BG is set with clampBG(), which adjusts both plasma (Q1) and peripheral (Q2) glucose
proportionally and runs 15 sim-minutes for equilibration — this avoids discontinuities at the start of the charts.
Then a scenario (e.g. insulin dose, meal, exercise) is simulated by calling
sim.update(1.0) minute by minute, and BG is logged. The resulting curves are plotted on canvas
and compared with expected physiological values.
Default profile: 70 kg, ISF=3.0 mmol/L/U, ICR=10 g/U (unless otherwise specified).