test: tighten matrix shadowing assertion · openclaw/openclaw@1359d09
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,6 +8,15 @@ import {
|
8 | 8 | |
9 | 9 | const { prepareSecretsRuntimeSnapshot } = setupSecretsRuntimeSnapshotTestHooks(); |
10 | 10 | |
| 11 | +function requireMatrixConfig(snapshot: Awaited<ReturnType<typeof prepareSecretsRuntimeSnapshot>>) { |
| 12 | +const config = snapshot.config.channels?.matrix; |
| 13 | +expect(config).toBeDefined(); |
| 14 | +if (!config) { |
| 15 | +throw new Error("expected Matrix runtime config"); |
| 16 | +} |
| 17 | +return config; |
| 18 | +} |
| 19 | + |
11 | 20 | describe("secrets runtime snapshot matrix shadowing", () => { |
12 | 21 | it("ignores Matrix password refs that are shadowed by scoped env access tokens", async () => { |
13 | 22 | const snapshot = await prepareSecretsRuntimeSnapshot({ |
@@ -121,7 +130,7 @@ describe("secrets runtime snapshot matrix shadowing", () => {
|
121 | 130 | loadAuthStore: () => loadAuthStoreWithProfiles({}), |
122 | 131 | }); |
123 | 132 | |
124 | | -expect(snapshot.config.channels?.matrix?.password).toEqual({ |
| 133 | +expect(requireMatrixConfig(snapshot).password).toEqual({ |
125 | 134 | source: "env", |
126 | 135 | provider: "default", |
127 | 136 | id: "MATRIX_PASSWORD", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。