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 }));
|
||||
});
|
||||
Reference in new issue
Block a user