helps manage and harmonise READMEs in many repositories with template files available on deno.land/x/readme_manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
readme-manager/log_test.ts

23 lines
575 B

import { assertThrows } from "https://deno.land/std@0.146.0/testing/asserts.ts";
import { error } from "./log.ts";
Deno.test("log", async (t) => {
const testingPath = await Deno.makeTempFile();
await t.step("error handler", () => {
const errorHandler = error(testingPath);
assertThrows(() => {
errorHandler("Testing.");
});
});
await t.step("error handler debug mode", () => {
const errorHandler = error(testingPath, false, true);
assertThrows(() => {
errorHandler("Testing.");
});
});
await Deno.remove(testingPath);
});