Convert all tests to TypeScript

This commit is contained in:
Alex Gleason
2023-05-10 16:10:19 -05:00
committed by fiatjaf_
parent 64caef9cda
commit 18e8227123
32 changed files with 439 additions and 405 deletions

17
test-helpers.ts Normal file
View File

@@ -0,0 +1,17 @@
import {type Event} from '.'
type EventParams<K extends number> = Partial<Event<K>>
/** Build an event for testing purposes. */
export function buildEvent<K extends number = 1>(params: EventParams<K>): Event<K> {
return {
id: '',
kind: 1 as K,
pubkey: '',
created_at: 0,
content: '',
tags: [],
sig: '',
...params
}
}