precision-game/js/test.mjs
2023-10-25 19:17:07 +02:00

8 lines
169 B
JavaScript

export function assert (message, check) {
if (typeof check == "function") {
check = check();
}
if (check !== true) {
throw("assertion failure: " + message);
}
}