test: tighten github copilot auth assertion · openclaw/openclaw@57e2aa2
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/github-copilot
| Original file line number | Diff line number | Diff line change |
|---|
@@ -84,19 +84,26 @@ describe("resolveFirstGithubToken", () => {
|
84 | 84 | }); |
85 | 85 | |
86 | 86 | it("resolves non-env SecretRefs when config is available", async () => { |
| 87 | +const config = { secrets: { defaults: { provider: "default" } } } as never; |
| 88 | +const env = {} as NodeJS.ProcessEnv; |
87 | 89 | const result = await resolveFirstGithubToken({ |
88 | | -config: { secrets: { defaults: { provider: "default" } } } as never, |
89 | | -env: {} as NodeJS.ProcessEnv, |
| 90 | + config, |
| 91 | + env, |
90 | 92 | }); |
91 | 93 | |
92 | 94 | expect(result).toEqual({ |
93 | 95 | githubToken: "resolved-profile-token", |
94 | 96 | hasProfile: true, |
95 | 97 | }); |
96 | | -expect(resolveRequiredConfiguredSecretRefInputStringMock).toHaveBeenCalledWith( |
97 | | -expect.objectContaining({ |
98 | | -path: "providers.github-copilot.authProfiles.github-copilot:github.tokenRef", |
99 | | -}), |
100 | | -); |
| 98 | +expect(resolveRequiredConfiguredSecretRefInputStringMock).toHaveBeenCalledWith({ |
| 99 | + config, |
| 100 | + env, |
| 101 | +value: { |
| 102 | +source: "file", |
| 103 | +provider: "default", |
| 104 | +id: "/providers/github-copilot/token", |
| 105 | +}, |
| 106 | +path: "providers.github-copilot.authProfiles.github-copilot:github.tokenRef", |
| 107 | +}); |
101 | 108 | }); |
102 | 109 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。