mvp-ai's picture
download
raw
1.15 kB
// Copyright (c) 2026 the Zuke contributors
// SPDX-License-Identifier: MIT
import { isLogLevel, LEVEL_ORDER, resolveLevel } from "../src/level.ts";
import { assertEquals } from "../../core/tests/_assert.ts";
Deno.test("isLogLevel recognises the severity ladder", () => {
assertEquals(isLogLevel("trace"), true);
assertEquals(isLogLevel("silent"), true);
assertEquals(isLogLevel("verbose"), false);
});
Deno.test("LEVEL_ORDER is monotonic from trace to silent", () => {
assertEquals(LEVEL_ORDER.trace < LEVEL_ORDER.debug, true);
assertEquals(LEVEL_ORDER.info < LEVEL_ORDER.warn, true);
assertEquals(LEVEL_ORDER.error < LEVEL_ORDER.silent, true);
});
Deno.test("resolveLevel reads ZUKE_LOG_LEVEL case-insensitively", () => {
assertEquals(
resolveLevel((n) => (n === "ZUKE_LOG_LEVEL" ? "DEBUG" : undefined)),
"debug",
);
assertEquals(
resolveLevel((n) => (n === "ZUKE_LOG_LEVEL" ? "error" : undefined)),
"error",
);
});
Deno.test("resolveLevel defaults to info when unset or invalid", () => {
assertEquals(resolveLevel(() => undefined), "info");
assertEquals(resolveLevel(() => "chatty"), "info");
});

Xet Storage Details

Size:
1.15 kB
·
Xet hash:
82b0faa994516720afacb02b2ad39b3ddba686fefa7d17942e7539a8344d8851

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.