Method Chaining
#1641
Replies: 1 comment
-
|
I got the undefined behavior to work when using Visual Studio Code's debugger by changing from For some reason I was under some assumption that vi.fn() would create a method that is executable, but it doesn't appear to be the case? Maybe someone can provide an explanation? Maybe there is something I did not understand about Javascript or Vitest? |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have been working on mocking packages with method chaining, but I was having undefined exceptions for something like this:
This is what I did to mock the library:
and I have tried this variant as well:
When I debugged the code on Visual Studio Code, the debugger was showing that
client.message.send('hi vitest')returns an object with this property:The debugger should show that
client.message.send('hi vitest')['done']andclient.message.send('hi vitest').donewas defined, butclient.message.send('hi vitest').done()was undefined. I am not sure how to get the method chaining to work.Beta Was this translation helpful? Give feedback.
All reactions