calendar-ics-normalizer-performance.test.mjs
sha256:c2dbf04d56308f3bbf2d06e6d2eb022b8948b1e827195fe525a44e5e18d5f9c0
feat(auth): Phase B Connect cloud agent (RFC 8628) + Hermes…
Human
minor
⚠ breaking
11 days 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:93bcf8f9bd56d8c5b9339f4ec73b9ebd66571398d56262d38eedc2cfa9db9882
fix(test): align Band B landing assertion with desktop MCP …
Human
11 days ago