New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to capture and return value? #16
Comments
Thanks for reporting, I will add this functionality soon. Currently you can use |
Yes, that's what I ended up doing. Works fine, just not as fluent as I'd wish it was. But apart from that; ts-mockito is just lovely to work with :) |
Thanks for appreciation. As I wrote earlier I will add functionality to capture and stub mock with API that you tried to use: |
Should be fixed in 2.0 version. Please reopen if something is still wrong. |
What was the end result? I'm using 2.6.1 and can't seem to find a way to do this. What I would like is something similar to your comment above: |
@alexleen I had your issue and I ended up using https://github.com/NagRock/ts-mockito/#custom-function |
I'm trying to do both a capture and return on the same mock, but I can't figure out how to set it up. This is my attempt so far:
It seems that I can only do one or the other? Depending on whether I call
thenCapture
beforethenReturn
or vice versa it will only capture OR return the value.Btw. What I'd really like to write is this;
...but both
thenReturn
andthenCapture
returnsvoid
The text was updated successfully, but these errors were encountered: