Signed-off-by: Onur Özkan <work@onurozkan.dev>
This commit is contained in:
Onur Özkan committed 2026-08-17 18:51:40 +03:00
1 parent 43347c1172
commit 6e15063502
122 files changed
+7848 -9828

No files matched your search

@@ -0,0 +1,9 @@
import { describe, expect, it } from 'vitest';
import { validateEvent } from './eventValidation';
describe('event validation', () => {
it.each([
[{}, 'Unsupported event schema'],
[{ schemaVersion: 1 }, 'Missing envelope identity'],
[{ schemaVersion: 1, eventId: 'a', streamId: 's', entity: {}, sequence: -1 }, 'Invalid monotonic sequence'],
])('rejects malformed envelopes', (value, reason) => expect(validateEvent(value)).toEqual({ valid: false, reason }));
});