






















@@ -3,6 +3,16 @@ import { asConfig, setupSecretsRuntimeSnapshotTestHooks } from "./runtime.test-s
3344const { prepareSecretsRuntimeSnapshot } = setupSecretsRuntimeSnapshotTestHooks();
556+function expectWarningPaths(
7+snapshot: Awaited<ReturnType<typeof prepareSecretsRuntimeSnapshot>>,
8+expectedPaths: string[],
9+): void {
10+const warningPaths = new Set(snapshot.warnings.map((warning) => warning.path));
11+for (const expectedPath of expectedPaths) {
12+expect(warningPaths.has(expectedPath)).toBe(true);
13+}
14+}
15+616async function expectInactiveGatewayPassword(config: unknown): Promise<void> {
717const snapshot = await prepareSecretsRuntimeSnapshot({
818config: asConfig(config),
@@ -66,9 +76,7 @@ describe("secrets runtime gateway local surfaces", () => {
6676provider: "default",
6777id: "MISSING_REMOTE_PASSWORD",
6878});
69-expect(snapshot.warnings.map((warning) => warning.path)).toEqual(
70-expect.arrayContaining(["gateway.remote.token", "gateway.remote.password"]),
71-);
79+expectWarningPaths(snapshot, ["gateway.remote.token", "gateway.remote.password"]);
7280});
73817482it("treats gateway.auth.password ref as active when mode is unset and no token is configured", async () => {
@@ -215,9 +223,7 @@ describe("secrets runtime gateway local surfaces", () => {
215223provider: "default",
216224id: "REMOTE_GATEWAY_PASSWORD_REF",
217225});
218-expect(snapshot.warnings.map((warning) => warning.path)).toEqual(
219-expect.arrayContaining(["gateway.remote.token", "gateway.remote.password"]),
220-);
226+expectWarningPaths(snapshot, ["gateway.remote.token", "gateway.remote.password"]);
221227},
222228);
223229此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。