test: dedupe fixtures and test harness setup

This commit is contained in:
Peter Steinberger
2026-02-23 05:43:30 +00:00
parent 8af19ddc5b
commit 1c753ea786
75 changed files with 1886 additions and 2136 deletions

View File

@@ -0,0 +1,39 @@
import {
makeWhatsAppDirectiveConfig,
replyText,
sessionStorePath,
} from "./reply.directive.directive-behavior.e2e-harness.js";
import { getReplyFromConfig } from "./reply.js";
export async function runModelDirectiveText(
home: string,
body: string,
options: {
defaults?: Record<string, unknown>;
extra?: Record<string, unknown>;
includeSessionStore?: boolean;
} = {},
): Promise<string | undefined> {
const res = await getReplyFromConfig(
{ Body: body, From: "+1222", To: "+1222", CommandAuthorized: true },
{},
makeWhatsAppDirectiveConfig(
home,
{
model: { primary: "anthropic/claude-opus-4-5" },
models: {
"anthropic/claude-opus-4-5": {},
"openai/gpt-4.1-mini": {},
},
...options.defaults,
},
{
...(options.includeSessionStore === false
? {}
: { session: { store: sessionStorePath(home) } }),
...options.extra,
},
),
);
return replyText(res);
}