We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using the ApiMockServer during testing a problem can occur, when a call is made which is not properly mocked.
ApiMockServer
For example if during a test we call: ApiClient.get_households() without setting up a mock response first.
ApiClient.get_households()
The return value will correctly be set to: {:error, "No mock set for call", get_households, %{query: %{}}}
{:error, "No mock set for call", get_households, %{query: %{}}}
However the state in the ApiClientMockServer will be updated with the new state for mocks: {:get_households, %{query: %{}} => nil
ApiClientMockServer
mocks
{:get_households, %{query: %{}} => nil
This means that all following calls to assert that no mocks remain will fail: assert ApiMock.remaining_calls() == %{}
assert ApiMock.remaining_calls() == %{}
The correct behavior is to return the no mock set error, and leave the state unchanged.
The text was updated successfully, but these errors were encountered:
TODO:
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
When using the
ApiMockServer
during testing a problem can occur, when a call is made which is not properly mocked.For example if during a test we call:
ApiClient.get_households()
without setting up a mock response first.The return value will correctly be set to:
{:error, "No mock set for call", get_households, %{query: %{}}}
However the state in the
ApiClientMockServer
will be updated with the new state formocks
:{:get_households, %{query: %{}} => nil
This means that all following calls to assert that no mocks remain will fail:
assert ApiMock.remaining_calls() == %{}
The correct behavior is to return the no mock set error, and leave the state unchanged.
The text was updated successfully, but these errors were encountered: