Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

450 B
Raw Blame
import type { EventServices } from './events.services';

export function createTestEventServices() {
  const emittedEvents: { eventName: string; payload: Record<string, unknown> }[] = [];

  const services = {
    onEvent() {},
    emitEvent({ eventName, payload }) {
      emittedEvents.push({ eventName, payload });
    },
  } satisfies EventServices;

  return {
    ...services,
    getEmittedEvents() {
      return emittedEvents;
    },
  };
}