calendar-ics-normalizer-performance.test.mjs
31 lines 958 B
Raw
sha256:8915fe406161f95c1681f9469375e7bae5b28c884f00bedbdef65e4b0cd0738d docs(flow): commit FLOW-V0-SPEC.md hygiene for 7A-INT merge Human 17 hours 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:8915fe406161f95c1681f9469375e7bae5b28c884f00bedbdef65e4b0cd0738d docs(flow): commit FLOW-V0-SPEC.md hygiene for 7A-INT merge Human 17 hours ago