Keep test output quiet with opt-in diagnostic logs (#25)
Test runs stay quiet by default. Diagnostic logs can be enabled explicitly when troubleshooting, while normal application logging and saved scenario output remain available. Resolves #22. --------- Co-authored-by: ars9 <ars9@pm.me> Co-authored-by: agent <agent@halstation.halstation.local> Reviewed-on: #25 Co-authored-by: agent-codex <agent-codex@ars9.space>
This commit was merged in pull request #25.
This commit is contained in:
1 parent
8b48d4812d
commit
c0fe15dc01
24 files changed
+250
-36
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import "reflect-metadata";
|
||||
import { validateAppConfig } from "../src/config/app.config";
|
||||
import { LogMode, validateAppConfig } from "../src/config/app.config";
|
||||
import { durationSeconds } from "../src/common/interval";
|
||||
|
||||
describe("Authentication configuration", () => {
|
||||
@@ -12,6 +12,17 @@ describe("Authentication configuration", () => {
|
||||
expect(config.AUTH_REVOKED_TOKEN_CLEANUP_CRON).toBe("0 3 * * *");
|
||||
});
|
||||
|
||||
it("defaults to console logging and accepts debug logging", () => {
|
||||
expect(validateAppConfig({}).LOG_MODE).toBe(LogMode.Console);
|
||||
expect(validateAppConfig({ LOG_MODE: "debug" }).LOG_MODE).toBe(
|
||||
LogMode.Debug,
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects unsupported logging modes", () => {
|
||||
expect(() => validateAppConfig({ LOG_MODE: "silent" })).toThrow();
|
||||
});
|
||||
|
||||
it("parses explicit true and false values without JavaScript truthiness", () => {
|
||||
expect(validateAppConfig({ AUTH_ENABLED: "false" }).AUTH_ENABLED).toBe(
|
||||
false,
|
||||
|
||||
Reference in new issue
Block a user