@@ -437,3 +437,26 @@ test("checkpoints are not logged, provider-executed calls end a turn, and empty
|
||||
"user: next",
|
||||
]);
|
||||
});
|
||||
|
||||
test.each([{}, { compactionModel: "", dataDir: "" }])(
|
||||
"without compactionModel (%j), optchat registers nothing",
|
||||
async (options) => {
|
||||
const registered: string[] = [];
|
||||
const record = (name: string) => async () => {
|
||||
registered.push(name);
|
||||
return { dispose: async () => {} };
|
||||
};
|
||||
const context = {
|
||||
options,
|
||||
tool: { transform: record("tool") },
|
||||
command: { transform: record("command") },
|
||||
session: { hook: record("hook") },
|
||||
};
|
||||
// SAFETY: setup must return before touching any host service; a call is recorded and fails the test.
|
||||
const setup = optchat.setup as (
|
||||
context: Pick<Plugin.Context, "options">,
|
||||
) => ReturnType<typeof optchat.setup>;
|
||||
expect(await setup(context)).toBeUndefined();
|
||||
expect(registered).toEqual([]);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user