How to properly mock moment.js helper function #2202
Replies: 1 comment
-
I don't think this has anything to do with Vue Test Utils, but the mock probably needs to be declared before mounting the component. I usually use In the future, if you want help, please add a small repro online using https://stackblitz.com/github/vuejs/create-vue-templates/tree/main/typescript-vitest?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts but keep the questions focused on Vue Test Utils |
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
-
Hey, still struggling with unit tests, now i am testing the component which is using some utility function (moment js converter), how do i properly mock it, to prevent of getting this error:
component template:
filter function:
test case:
Certainly i am doing some thing incorrect, any tips highly appreciate!
Beta Was this translation helpful? Give feedback.
All reactions