From 61caeb5f376d56126c94507b90aceac68eca4c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 21:39:37 -0400 Subject: [PATCH] test(database): align with vault insecure-fallback opt-in convention Aligns tests/unit/database.test.ts with the existing convention in oauth-login-service/credential-resolver/credential-store tests: set AGENTCOMPANY_ALLOW_INSECURE_VAULT=true in beforeAll so the in-memory database test can call saveSecret without a real OS keychain. Follow-up to aa1afd0 which removed the NODE_ENV=test/VITEST auto-enable. --- tests/unit/database.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/database.test.ts b/tests/unit/database.test.ts index 9036c105..4cedff0f 100644 --- a/tests/unit/database.test.ts +++ b/tests/unit/database.test.ts @@ -1,7 +1,11 @@ import { join } from "node:path"; import { tmpdir } from "node:os"; import { mkdtemp, rm } from "node:fs/promises"; -import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; + +beforeAll(() => { + process.env.AGENTCOMPANY_ALLOW_INSECURE_VAULT = "true"; +}); vi.mock("electron", () => ({ safeStorage: {