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.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-16 21:39:37 -04:00
1 parent deb980448c
commit 61caeb5f37
1 file changed
+5 -1
+5 -1
View File
@@ -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: {