Skip to content
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

Add thenReturn to PromiseStubber type declaration #481

Merged
merged 3 commits into from Apr 17, 2022

Conversation

johnbotris
Copy link
Contributor

This allows you to stub an async function with a sequence of promises that may either resolve or reject.

It will also not allow you to provide non-promise values when stubbing async functions (which is good)

closed #478

@johnbotris
Copy link
Contributor Author

@billtong would be great if you can check if it works for your use case, for mine it is good (I think we have the exact same situation)

@johnbotris
Copy link
Contributor Author

I will add some tests

This allows you to stub an async function with a sequence of
promises that may either resolve or reject
To ensure that `PromiseStubber.thenReturn` will compile
@searls
Copy link
Member

searls commented Mar 1, 2022

Let me know when you think this is ready for review

@billtong
Copy link

billtong commented Mar 1, 2022

@johnbotris I just test my code with your commits. it's working great. Thanks!

@johnbotris
Copy link
Contributor Author

@billtong Thanks!
@searls It's ready

@searls searls merged commit 62b1884 into testdouble:main Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stubbing sequential promise results
3 participants