MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / readReportEvents

Function readReportEvents

packages/server-e2e/src/report.ts:121–140  ·  view source on GitHub ↗
(reportDir = defaultReportDir())

Source from the content-addressed store, hash-verified

119}
120
121export function readReportEvents(reportDir = defaultReportDir()): StoredReportEvent[] {
122 if (!existsSync(reportDir)) return [];
123 const files = readdirSync(reportDir)
124 .filter((file) => file.startsWith('events-') && file.endsWith('.jsonl'))
125 .toSorted();
126 const events: StoredReportEvent[] = [];
127 for (const file of files) {
128 const text = readFileSync(join(reportDir, file), 'utf8');
129 for (const line of text.split('\n')) {
130 if (line.trim().length === 0) continue;
131 events.push(JSON.parse(line) as StoredReportEvent);
132 }
133 }
134 return events.toSorted((a, b) => {
135 const byTime = Date.parse(a.at ?? '') - Date.parse(b.at ?? '');
136 if (byTime !== 0) return byTime;
137 if (a.pid !== b.pid) return a.pid - b.pid;
138 return a.ordinal - b.ordinal;
139 });
140}
141
142export function writeHtmlReport(options?: HtmlReportOptions): string {
143 const reportDir = options?.reportDir ?? defaultReportDir();

Callers 2

report.test.tsFile · 0.90
writeHtmlReportFunction · 0.85

Calls 2

defaultReportDirFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected