-
Notifications
You must be signed in to change notification settings - Fork 162
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
[Kayrock Preparations] Structs and unit tests #483
Conversation
defmodule KafkaEx.NetworkClientTest do | ||
use ExUnit.Case, async: true | ||
|
||
use Hammox.Protect, |
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.
I've not used Hammox, but reading through and doing some testing myself, it seems like this call just creates wrappers that will additionally fail if dialyzer types don't match? In testing locally, the function calls here are definitely still calling through to the originals, so there are no real mocks created.
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.
I'm using Hammox quite a lot.
You have two modes there, one with use Hamox.Protect
it will wrap function & check in in run time same way as dialyzer in compile time. It's quite useful as it allows you to validate behaviors when dialyzer sometimes is too optimistic.
I prefer to test it both ways, using DIalyzer & Hammox, but if you think it's overkill we can drop one. As end goal, I'd like to make it easy to mock entire kafka_ex
in projects with type safe behaviours.
Co-authored-by: Joshua Scott <[email protected]>
@joshuawscott is it ok? |
7f4c850
to
e4a306f
Compare
Fix module name to be same as path
e4a306f
to
1fc35af
Compare
Overview
same kind of modules
under same path in application code.What Next?
Goal