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

Improve expect(stub).secondCall.calledWith(...) error message when called once #15

Open
1 task
kuceb opened this issue Aug 11, 2019 · 0 comments
Open
1 task

Comments

@kuceb
Copy link

kuceb commented Aug 11, 2019

Current, if the stub was only called once, and you try to chain something off .secondCall, you get a terrible error message:

// stub was only called once
expect(stub).secondCall.calledWith(...)

TypeError: Cannot read property 'calledWith' of undefined

Desired Error message:

"Error: expected stub to be calledTwice, but it was only called once"

This also goes for firstCall, thirdCall, and getCall(n)

Tasks

  • check if this is fixed already in upstream repo
@kuceb kuceb changed the title Improve expect(stub).secondCall.calledWith(...) error message when only one call Improve expect(stub).secondCall.calledWith(...) error message when called once Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant