refactor: dedupe agent and browser cli helpers

This commit is contained in:
Peter Steinberger
2026-03-03 00:14:48 +00:00
parent fe14be2352
commit fd3ca8a34c
46 changed files with 1051 additions and 1117 deletions

View File

@@ -74,3 +74,10 @@ export function makeGeminiCliAssistantMessage(model: string, content: unknown) {
timestamp: 0,
};
}
export function expectConvertedRoles(contents: Array<{ role?: string }>, expectedRoles: string[]) {
expect(contents).toHaveLength(expectedRoles.length);
for (const [index, role] of expectedRoles.entries()) {
expect(contents[index]?.role).toBe(role);
}
}