Files
immich/web/src/lib/__mocks__/animate.mock.ts
Daniel Dietzler eadcbd52fb chore: svelte 5 🎉 (#13738)
chore: svelte 5

Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
2024-11-02 10:49:07 -05:00

18 lines
369 B
TypeScript

import { tick } from 'svelte';
import { vi } from 'vitest';
export const getAnimateMock = () =>
vi.fn().mockImplementation(() => {
let onfinish: (() => void) | null = null;
void tick().then(() => onfinish?.());
return {
set onfinish(fn: () => void) {
onfinish = fn;
},
cancel() {
onfinish = null;
},
};
});