diff options
Diffstat (limited to 'tests/runner.mjs')
-rw-r--r-- | tests/runner.mjs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/runner.mjs b/tests/runner.mjs deleted file mode 100644 index c17c0d0..0000000 --- a/tests/runner.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import process from "node:process"; - -const red = s => `\x1b[31m${s}\x1b[0m`; -const green = s => `\x1b[32m${s}\x1b[0m`; -const yellow = s => `\x1b[33m${s}\x1b[0m`; - -const t = { - tap: x => { - console.error("tap:", x); - return x; - }, - start: msg => { - console.error(`${msg}:`); - }, - test: async (msg, fn) => { - process.stderr.write(`${yellow("testing")}: ${msg}... `); - try { - await fn(); - } catch (e) { - process.stderr.write(`${red("FAIL\n")}`); - throw e; - } - process.stderr.write(`${green("OK\n")}`); - }, -}; - -export const runTests = async tests => { - for (const testFn of tests) { - await testFn(t); - } -}; |