refactor(usage): transcript readers come from their drivers (#17576)
Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
507361bc73
commit
e5dca2332f
34 files changed
+1731
-1411
No files matched your search
@@ -5,6 +5,7 @@ import * as NodePath from "node:path";
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it } from "@effect/vitest";
|
||||
|
||||
import { TEST_FORMATS } from "./usageTestFormats.ts";
|
||||
import {
|
||||
readTranscriptRecords as readWithDefaultThreshold,
|
||||
type TranscriptParsePosition,
|
||||
@@ -16,7 +17,10 @@ const readTranscriptRecords = (
|
||||
path: string,
|
||||
provider: "claude" | "codex" | "grok",
|
||||
position?: TranscriptParsePosition,
|
||||
) => readWithDefaultThreshold(path, provider, position, { streamingThresholdBytes: 256 * 1024 });
|
||||
) =>
|
||||
readWithDefaultThreshold(path, TEST_FORMATS[provider], position, {
|
||||
streamingThresholdBytes: 256 * 1024,
|
||||
});
|
||||
|
||||
let dir: string;
|
||||
beforeEach(async () => {
|
||||
@@ -144,7 +148,7 @@ describe("large usage records", () => {
|
||||
);
|
||||
const actual = await scan(large, provider);
|
||||
expect(actual.records).toEqual(expected.records);
|
||||
expect(actual.position.codexState).toEqual(expected.position.codexState);
|
||||
expect(actual.position.state).toEqual(expected.position.state);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user