Files
OmniRoute/tests/unit/settings-debugmode-default.test.ts
Diego Rodrigues de Sa e Souza c1e30b7676 Release v3.8.51
Release v3.8.51 — 2,022 documented changes (235 features, 1,454 fixes, 333 maintenance) from 1,973 cycle commits and 301 external contributors; full changelog in CHANGELOG.md → [3.8.51]. Full ci.yml matrix green on 2f42a9ac (57 checks).
2026-09-29 19:58:13 -03:00

28 lines
1.1 KiB
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { cleanupTempDataDir } from "../_setup/tempDataDir.ts";
// Isolated DATA_DIR so persisted settings rows don't mask the default.
const TEST_DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-settings-debugmode-"));
process.env.DATA_DIR = TEST_DATA_DIR;
process.env.API_KEY_SECRET = process.env.API_KEY_SECRET || "settings-debugmode-test-secret";
const { getSettings } = await import("../../src/lib/db/settings.ts");
test("debugMode defaults to false for fresh installs (no persisted setting)", async () => {
const settings = await getSettings();
assert.equal(settings.debugMode, false, "debugMode should default to false, not true");
});
test("logToolSources defaults to false", async () => {
const settings = await getSettings();
assert.equal(settings.logToolSources, false, "logToolSources should default to false");
});
test.after(async () => {
await cleanupTempDataDir(TEST_DATA_DIR);
});