mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
16 lines
500 B
TypeScript
16 lines
500 B
TypeScript
import { assertEquals } from '@/deps-test.ts';
|
|
|
|
import event1 from '~/fixtures/events/event-1.json' assert { type: 'json' };
|
|
|
|
import { memorelay } from './memorelay.ts';
|
|
|
|
Deno.test('memorelay', async () => {
|
|
assertEquals(await memorelay.countEvents([{ ids: [event1.id] }]), 0);
|
|
|
|
await memorelay.storeEvent(event1);
|
|
|
|
assertEquals(await memorelay.countEvents([{ ids: [event1.id] }]), 1);
|
|
|
|
const result = await memorelay.getEvents([{ ids: [event1.id] }]);
|
|
assertEquals(result[0], event1);
|
|
});
|