mudasobwa
Mocks Are Your Friends, Not Your Servants
Łukasz wrote a great article, 'guiding not ruling’ the way of writing tests. I agree with everything, short of his attitude to mocks. The furter discussion revealed that we treat mocks in an absolutely different manner.
I
mocks, and here is why.
Most Liked
felix-starman
I need to restart my work on DoubleAgent. I was discouraged by all the mock libraries that came out and I never had time to come back and finish it, but maybe this will give me the kick in the pants to do it.
I generally agree with all of the things you said here. My only addition to the conversation is to not call it a mock anymore since there’s too much baggage around it or people misunderstand it.
I like the framing of it as something that collaboratively works with you to validate the contract from the inside.
I have thought similarly for a long time and that was part of why after using double and working with its creator/mantainer in the past I thought a better name would be double agent, because it’s running in the implementation but it’s working for you.
I also have a whole lot of plans for how it can be iteratively employed and guide you from a very simple non-ideal approach to a fully speced out behaviour where all of the best features come about and become easy from following the best practices.
It’s a great article. Thank you for writing it
code-shoily
Just shared this with colleagues. Loved this article.
Popular in Blog Posts
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









