

























@@ -20,6 +20,15 @@ import { asConfig, setupSecretsRuntimeSnapshotTestHooks } from "./runtime.test-s
20202121const { prepareSecretsRuntimeSnapshot } = setupSecretsRuntimeSnapshotTestHooks();
222223+function requireDiscordConfig(snapshot: Awaited<ReturnType<typeof prepareSecretsRuntimeSnapshot>>) {
24+const config = snapshot.config.channels?.discord;
25+expect(config).toBeDefined();
26+if (!config) {
27+throw new Error("expected Discord runtime config");
28+}
29+return config;
30+}
31+2332describe("secrets runtime external channel origin discovery", () => {
2433it("discovers loadable plugins for channel SecretRefs when plugins.entries is absent", async () => {
2534loadPluginMetadataSnapshotMock.mockReturnValue({
@@ -68,7 +77,7 @@ describe("secrets runtime external channel origin discovery", () => {
6877includeAuthStoreRefs: false,
6978});
707971-expect(snapshot.config.channels?.discord?.token).toBe("resolved-discord-token");
80+expect(requireDiscordConfig(snapshot).token).toBe("resolved-discord-token");
7281expect(loadPluginMetadataSnapshotMock).toHaveBeenCalled();
7382expect(loadChannelSecretContractApiMock).toHaveBeenCalledWith(
7483expect.objectContaining({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。