perf(config): skip shell env fallback for explicit empty vars

This commit is contained in:
Vincent Koc
2026-04-13 19:09:02 +01:00
parent 8c43768e27
commit 114ff23f2a
3 changed files with 33 additions and 2 deletions

View File

@@ -12,6 +12,14 @@ const resolveIsNixModeMock = vi.hoisted(() => vi.fn(() => false));
const resolveSecretInputRefMock = vi.hoisted(() =>
vi.fn((): { ref: unknown } => ({ ref: undefined })),
);
const hasConfiguredSecretInputMock = vi.hoisted(() =>
vi.fn((value: unknown): boolean => {
if (typeof value === "string" && value.trim()) {
return true;
}
return resolveSecretInputRefMock(value as never)?.ref != null;
}),
);
const resolveGatewayAuthMock = vi.hoisted(() =>
vi.fn(() => ({
mode: "token",
@@ -70,6 +78,7 @@ vi.mock("../../config/paths.js", () => ({
}));
vi.mock("../../config/types.secrets.js", () => ({
hasConfiguredSecretInput: hasConfiguredSecretInputMock,
resolveSecretInputRef: resolveSecretInputRefMock,
}));