mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-21 21:56:46 +00:00
test: tighten runtime plugin origin assertions
This commit is contained in:
@@ -69,16 +69,30 @@ describe("prepareSecretsRuntimeSnapshot loadable plugin origins", () => {
|
||||
includeAuthStoreRefs: false,
|
||||
});
|
||||
|
||||
expect(manifestMocks.loadPluginMetadataSnapshot).toHaveBeenCalledWith({
|
||||
config: expect.objectContaining({
|
||||
plugins: expect.any(Object),
|
||||
}),
|
||||
workspaceDir: expect.any(String),
|
||||
env: expect.objectContaining({
|
||||
HOME: "/home/demo",
|
||||
DEMO_API_KEY: "sk-demo",
|
||||
}),
|
||||
const snapshotCalls = manifestMocks.loadPluginMetadataSnapshot.mock.calls as unknown as Array<
|
||||
[
|
||||
{
|
||||
config: {
|
||||
plugins?: unknown;
|
||||
};
|
||||
workspaceDir: unknown;
|
||||
env: Record<string, unknown>;
|
||||
},
|
||||
]
|
||||
>;
|
||||
const snapshotParams = snapshotCalls[0]?.[0];
|
||||
expect(snapshotParams?.config.plugins).toStrictEqual({
|
||||
entries: {
|
||||
demo: {
|
||||
config: {
|
||||
apiKey: { source: "env", provider: "default", id: "DEMO_API_KEY" },
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(typeof snapshotParams?.workspaceDir).toBe("string");
|
||||
expect(snapshotParams?.env.HOME).toBe("/home/demo");
|
||||
expect(snapshotParams?.env.DEMO_API_KEY).toBe("sk-demo");
|
||||
expect(manifestMocks.listPluginOriginsFromMetadataSnapshot).toHaveBeenCalledWith(snapshot);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user