testit/test/runner.js

16 lines
510 B
JavaScript
Raw Permalink Normal View History

2020-09-20 19:58:00 +00:00
import spec from "./index.spec.js";
spec.run(false, function (r) {
let errors = [];
document.body.style.backgroundColor = (
r.fail.length ? "#ff9999" : "#99ff99"
);
r.pass.forEach((p) => errors.push(`<br>${p}`));
r.fail.forEach((f) => errors.push(`<br><b>${f}</b>`));
2022-07-31 05:40:35 +00:00
document.querySelector("#errors").innerHTML = errors;
document.querySelector("#summary").innerHTML = `| tests: ${r.pass.length + r.fail.length} | pass: ${r.pass.length} | fail: ${r.fail.length} |`;
2020-09-20 19:58:00 +00:00
});