ditto/src/test.ts

8 lines
308 B
TypeScript
Raw Normal View History

import { NostrEvent } from '@nostrify/nostrify';
/** Import an event fixture by name in tests. */
export async function eventFixture(name: string): Promise<NostrEvent> {
const result = await import(`~/fixtures/events/${name}.json`, { with: { type: 'json' } });
return structuredClone(result.default);
}