Files
immich/web/src/lib/__mocks__/animate.mock.ts
Daniel Dietzler ae7b9b0730 feat: vitest 4
2026-01-06 20:03:45 +01:00

18 lines
375 B
TypeScript

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;
},
};
});