-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
expect: Throw matcher error when received cannot be jasmine spy #8747
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jasmine spy functions do not provide information about return values
Ahh, that made clear why we're doing this 😄 LGTM
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Throw matcher error from
*Return*
matchers if received is a spy function, instead ofTypeError: received.getMockName is not a function
isSpy
function to test for bothall
andcount
methodsensureMock
asensureMockOrSpy
for*Call*
matchersensureMock
function for*Return*
matchersEDIT: Jasmine spy functions do not provide information about return values
Test plan
createSpy
in test file to return a mock of a spy function, becausejasmine.createSpy
is not defined whenjest-circus
is the test runner*Called*
assertions with spy functions*Called*
assertions with spy functions*Return*
assertions with ordinary function*Return*
assertions with spy functions