globalThis.test = (suite, tests) => { process.stdout.write(suite + ": "); for (const [name, t] of Object.entries(tests)) { try { t(); process.stdout.write("."); } catch(ex) { console.error("In " + suite +", test " + name + " failed:", ex) } } console.log(); } // For global scope globalThis.assert = (cond, msg) => { if (!cond) throw new Error(msg); };