events.test: fix type error
This commit is contained in:
parent
56373c4ce3
commit
4ce51014de
|
@ -7,12 +7,12 @@ import { eventsDB as db } from './events.ts';
|
|||
|
||||
Deno.test('count filters', async () => {
|
||||
assertEquals(await db.countEvents([{ kinds: [1] }]), 0);
|
||||
await db.storeEvent(event1, { user: undefined });
|
||||
await db.storeEvent(event1);
|
||||
assertEquals(await db.countEvents([{ kinds: [1] }]), 1);
|
||||
});
|
||||
|
||||
Deno.test('insert and filter events', async () => {
|
||||
await db.storeEvent(event1, { user: undefined });
|
||||
await db.storeEvent(event1);
|
||||
|
||||
assertEquals(await db.getEvents([{ kinds: [1] }]), [event1]);
|
||||
assertEquals(await db.getEvents([{ kinds: [3] }]), []);
|
||||
|
@ -25,14 +25,14 @@ Deno.test('insert and filter events', async () => {
|
|||
});
|
||||
|
||||
Deno.test('delete events', async () => {
|
||||
await db.storeEvent(event1, { user: undefined });
|
||||
await db.storeEvent(event1);
|
||||
assertEquals(await db.getEvents([{ kinds: [1] }]), [event1]);
|
||||
await db.deleteEvents([{ kinds: [1] }]);
|
||||
assertEquals(await db.getEvents([{ kinds: [1] }]), []);
|
||||
});
|
||||
|
||||
Deno.test('query events with local filter', async () => {
|
||||
await db.storeEvent(event1, { user: undefined });
|
||||
await db.storeEvent(event1);
|
||||
|
||||
assertEquals(await db.getEvents([{}]), [event1]);
|
||||
assertEquals(await db.getEvents([{ local: true }]), []);
|
||||
|
|
Loading…
Reference in New Issue