Independent education · Sources and limitations documented
Portfolio / Smart NOA simulation

Software simulation

Source snapshot · 5 November 2026

simulator/tests/index.js

// Entry point so that `node --test simulator/tests` works on Node ≥ 22, where a bare
// directory argument is resolved as a module (index.js) rather than searched for tests.
// It loads every *.test.mjs file in this folder into the same node:test run.
// (`node --test simulator/tests/*.test.mjs` runs the same files without this shim.)
import { readdirSync } from 'node:fs';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { dirname, join } from 'node:path';

const here = dirname(fileURLToPath(import.meta.url));
for (const f of readdirSync(here).filter((n) => n.endsWith('.test.mjs')).sort()) {
  await import(pathToFileURL(join(here, f)).href);
}
Source and scope

Published from Smart-NOA-Controller/simulator/tests/index.js at revision 6e5b205e3843. Full source text is retained; HTML presentation does not establish independent clinical review. In-memory simulation with no patient, monitor or pump interface; not clinically validated.