Skip to content

High performance self-hosted photo and video management solution.

375 B
Raw Blame
import { tick } from 'svelte';
import { vi } from 'vitest';

export const getAnimateMock = () =>
  vi.fn().mockImplementation(function () {
    let onfinish: (() => void) | null = null;
    void tick().then(() => onfinish?.());

    return {
      set onfinish(fn: () => void) {
        onfinish = fn;
      },
      cancel() {
        onfinish = null;
      },
    };
  });