calendar-ics-normalizer-performance.test.mjs
31 lines 958 B
Raw
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor ⚠ breaking 1 day ago
1 /**
2 * Tier 6 — PERFORMANCE: parse throughput smoke (no network).
3 */
4 import { describe, it } from 'node:test';
5 import assert from 'node:assert/strict';
6 import { parseIcsToEvents } from '../lib/calendar/ics-normalizer.mjs';
7
8 describe('Performance — 500-event parse completes within budget', () => {
9 it('parses 500 events in under 2 seconds', () => {
10 const chunks = ['BEGIN:VCALENDAR'];
11 for (let i = 0; i < 500; i += 1) {
12 chunks.push(
13 'BEGIN:VEVENT',
14 `UID:p-${i}@perf`,
15 'DTSTART:20260101T000000Z',
16 'DTEND:20260101T003000Z',
17 `SUMMARY:Event ${i}`,
18 'END:VEVENT',
19 );
20 }
21 chunks.push('END:VCALENDAR');
22 const text = chunks.join('\n');
23
24 const start = performance.now();
25 const events = parseIcsToEvents(text);
26 const elapsed = performance.now() - start;
27
28 assert.equal(events.length, 500);
29 assert.ok(elapsed < 2000, `parse took ${elapsed.toFixed(1)}ms`);
30 });
31 });
File History 1 commit
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor 1 day ago