Files
OmniRoute/tests/helpers/translationFixtures.ts
Diego Rodrigues de Sa e Souza 931afe3482 Fase 8 · Bloco B — suíte de correção (property + golden + SSE-correctness) (#3808)
Integrated into release/v3.8.25 — Fase 8 Bloco B (property + golden + SSE-correctness).
2026-06-14 18:02:51 -03:00

32 lines
883 B
TypeScript

import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../fixtures/translation");
export type TranslationCase = {
name: string;
sourceFormat: string;
targetFormat: string;
input: Record<string, unknown>;
expected?: unknown;
};
export type SseSequence = {
name: string;
chunks: string[];
expectedText: string;
};
export function loadTranslationFixtures(): TranslationCase[] {
return ["openai-to-claude", "claude-to-openai", "openai-to-gemini", "gemini-to-openai"].flatMap(
(f) => JSON.parse(fs.readFileSync(path.join(DIR, `${f}.json`), "utf8")) as TranslationCase[]
);
}
export function loadSseSequences(): SseSequence[] {
return JSON.parse(
fs.readFileSync(path.join(DIR, "sse-chunk-sequences.json"), "utf8")
) as SseSequence[];
}