You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
The test should succeed, both mocks should be tested. Instead, the second mock is not tested since the second request fails on the first mock. Why is the first mock tested even if the request path does not match with the second request?
Describe the bug
JSONPath returns error if path is not found which breaks the loop in
findMockForRequest
, skipping the rest of the mocks.To Reproduce
Steps to reproduce the behavior:
My mocks look like this:
Expected behavior
The test should succeed, both mocks should be tested. Instead, the second mock is not tested since the second request fails on the first mock. Why is the first mock tested even if the request path does not match with the second request?
Additional context
Returning nil instead of err here https://github.com/vitorsalgado/mocha/blob/3.x/expect/jsonpath.go#L22 fixes my tests.
The text was updated successfully, but these errors were encountered: