Creating spy/mock for a member.roles.add #8875
Replies: 1 comment 2 replies
-
I can't think of a good way to mock this without having an entire mock api running (which is too much work) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to mock member.roles.add in a test using
vitest
, but it's not working. I'm pretty new to testing and some help would be appreciated.interaction
is a mock that's generated like this.The test fails because
spy
is never called and I get an error cause there wasn't a token for theadd
request. Any ideas how to get it to work? Thanks.Beta Was this translation helpful? Give feedback.
All reactions