MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / withCodexFile

Function withCodexFile

src/core/parser-codex.test.ts:18–25  ·  view source on GitHub ↗
(lines: object[], run: (sessionsDir: string, filePath: string) => void)

Source from the content-addressed store, hash-verified

16import { MAX_FILE_SIZE } from './parser-shared';
17
18function withCodexFile(lines: object[], run: (sessionsDir: string, filePath: string) => void): void {
19 const root = fs.mkdtempSync(path.join(os.tmpdir(), 'codex-parser-test-'));
20 const dayDir = path.join(root, 'sessions', '2025', '06', '15');
21 fs.mkdirSync(dayDir, { recursive: true });
22 const file = path.join(dayDir, 'rollout-2025-06-15-test.jsonl');
23 fs.writeFileSync(file, lines.map(l => JSON.stringify(l)).join('\n'), 'utf-8');
24 try { run(path.join(root, 'sessions'), file); } finally { fs.rmSync(root, { recursive: true, force: true }); }
25}
26
27describe('parseCodexSessions', () => {
28 it('exposes final cumulative token_count totals as Session.modelUsage', () => {

Callers 1

Calls 1

runFunction · 0.85

Tested by

no test coverage detected