mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 17:25:35 +03:00
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>
18 lines
369 B
TypeScript
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;
|
|
},
|
|
};
|
|
});
|