Skip to content

doc: Explain behaviour of when/expect #153

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

timabell
Copy link

I found the behaviour of when/expect confusing, and couldn't see how to set the "always" behaviour. This patch adds a bit more clarity to that area of usage to the readme.

Hopefully I've the updated description of the behaviour is accurate, I've not used this library much.

Thanks for the library, solves a painful problem.

I found the behaviour of when/expect confusing, and couldn't see how to
set the "always" behaviour. This patch adds a bit more clarity to that
area of usage to the readme.
@richardszalay
Copy link
Owner

Apologies for the delayed reply on this, but isn't this effectively duplicating the "Match Behavior" section of the readme?

@timabell
Copy link
Author

Well, technically yes, but let me put it this way, I think I spent about 2 or 3 hours scratching my head why I wasn't getting a mock to hit when it was defined even after reading the existing docs. This proposed addition is how I would have liked it explained to me to be able get the mental model I needed to understand why the sequence of mocks behave as they do with the combinations of when / expect and the configuration.

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.

2 participants