mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-11-16 17:09:09 +00:00
Validated in the full merge-train on the .113 (lot 3c, 2026-11-11): typecheck, static gates and the full unit suite. Every failure from that run was re-run in isolation, both on the merged tree and on the train base. They come from the .113 root environment, load-sensitive timing, or known flakes. None trace back to this change. Co-authored-by: Bl0ck <36800583+Bl0ck154@users.noreply.github.com>
24 lines
1.0 KiB
TypeScript
24 lines
1.0 KiB
TypeScript
import { strict as assert } from "node:assert";
|
|
import { test } from "node:test";
|
|
|
|
import { formatCliError } from "../../bin/cli/utils/formatCliError.mjs";
|
|
|
|
test("CLI errors use the concise message by default", () => {
|
|
const error = new Error("provider unavailable");
|
|
assert.equal(formatCliError(error, false), "provider unavailable");
|
|
});
|
|
|
|
test("CLI stack output is available only with debug opt-in", () => {
|
|
const error = new Error("provider unavailable");
|
|
assert.equal(formatCliError(error, true), error.stack);
|
|
assert.equal(formatCliError(error, false), "provider unavailable");
|
|
});
|
|
|
|
test("CLI error formatting tolerates non-Error thrown values", () => {
|
|
assert.equal(formatCliError("unexpected failure", false), "unexpected failure");
|
|
assert.equal(formatCliError("unexpected failure", true), "unexpected failure");
|
|
assert.equal(formatCliError({ message: "custom error" }, true), "custom error");
|
|
assert.equal(formatCliError(undefined, false), "undefined");
|
|
assert.equal(formatCliError(null, true), "null");
|
|
});
|