Replies: 1 comment
-
I was wondering about the same thing, for my particular case I just used a readable with a function that returns back the key: vi.mock('$lib/i18n', async () => {
return { t: readable((key: string) => key) };
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I wonder If you have an example about how to mock "$t" in the template of a component ?
Example:
I use Vitest.dev to run unit test.
I try to mock a module '$lib/translations'.
It's ok for the method "get", but I don't know how to do about "subscribe".
Regards
Beta Was this translation helpful? Give feedback.
All reactions