(lines: object[], run: (sessionsDir: string, filePath: string) => void)
| 16 | import { MAX_FILE_SIZE } from './parser-shared'; |
| 17 | |
| 18 | function 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 | |
| 27 | describe('parseCodexSessions', () => { |
| 28 | it('exposes final cumulative token_count totals as Session.modelUsage', () => { |
no test coverage detected