<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="376964" data-post-id="376964">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mudasobwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/120/5298_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mudasobwa
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Cure</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="funboy" data-post="11" data-topic="73103">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/f/ee7513/48.png" class="avatar"> funboy:</div>
<blockquote>
<p>calc function for same data should return the same output</p>
</blockquote>
</aside>
<p>Absolutely. John Hughes with other smart guys even invented property-check tests for that. Andrea brough it to elixir world with <a href="https://hexdocs.pm/stream_data" rel="noopener nofollow ugc">stream_data</a>. Validating the one outcome for the one income would not do that, though.</p>
<aside class="quote no-group quote-modified" data-username="funboy" data-post="11" data-topic="73103">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/f/ee7513/48.png" class="avatar"> funboy:</div>
<blockquote>
<p>clean, small, fast, async unit tests are far better than test suites that require dozens of deeply-nested behaviour mocks</p>
</blockquote>
</aside>
<p>That’s a false dichotomy. I am not advocating for running a spaghetti monster. I am saying that if you need/want to test the function for the outcome, this function always deserves to be a part of some behaviour. That way you keep your code organized, contrary to a bunch of isolated functions, stuck to their impls.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376964" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-376964" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376964"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="376965" data-post-id="376965">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="funboy" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  funboy
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Maybe it’s just my perspective, but I usually introduce a behaviour only when I need more than one implementation of the same “behavior”. Adding a behaviour solely to enable mocking in tests has always felt a bit off to me.</p>
<p>e.g.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Boo do
 use Genserver
 
 def get_market_data() do
    ....
 end
end
</code></pre>
<p>vs</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule BooBehvaiour do
  @callback get_market_data() :: data
end

defmodule Boo do
 use GenServer
 @behaviour BooBehvaiour
 
 @impl
 def get_market_data() do
    ....
 end
end
</code></pre>
<p>Reading our discussion I think there’s also a chance we’re talking about two different things <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"></p>
<p>Could you walk me through what I should do if I want to test a piece of logic that depends on <code>Boo.get_market_data/0</code>, but I don’t want to start a process or mock all the underlying HTTP/DB calls? I’d just like to mock the return value of get_market_data() function to keep the test simple and async - how would you approach that? adding behavior to Boo?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376965" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-376965" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376965"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="376967" data-post-id="376967">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lud" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/120/14382_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lud
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I think it’s an architecture problem.</p>
<p>I would fix it like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def calc(data) do
  #
end
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir">assert 3 = calc([1, 1, 1])
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376967" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-376967" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376967"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="376968" data-post-id="376968">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="funboy" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  funboy
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah, the example isn’t ideal - we can move logic out to separate function and just pass data to it - I know.<br>
I just meant a scenario where you have logic that depends on other processes making HTTP/DB calls, but I didn’t want to introduce all that complexity into a simple forum example - that’s why I simplified it to just calc function <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376968" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-376968" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376968"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="376969" data-post-id="376969">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="funboy" data-post="13" data-topic="73103">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/f/ee7513/48.png" class="avatar"> funboy:</div>
<blockquote>
<p>Maybe it’s just my perspective, but I usually introduce a behaviour only when I need more than one implementation of the same “behavior”. Adding a behaviour solely to enable mocking in tests has always felt a bit off to me.</p>
</blockquote>
</aside>
<p>I always find this argument so funny given a test implemention is literally an additional implementation.</p>
<p>As for the “fetching data problem”. Why does this need to happen inline in the function doing the calculation. As <a class="mention" href="/u/lud" rel="nofollow">@lud</a> pointed out making data fetching and calculations independent make the whole problem of testability go away while imo aiding the composability of the business logic. <a href="https://www.destroyallsoftware.com/talks/boundaries" class="inline-onebox" rel="nofollow">Boundaries</a> is the long from version of that idea which goes into more detail.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376969" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-376969" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376969"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="376970" data-post-id="376970">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="funboy" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  funboy
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote" data-post="15" data-topic="73103">
  <div class="title">
    <div class="quote-controls"></div>
    <img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/f/ee7513/48.png" class="avatar">
    <div class="quote-title__text-content">
      <a href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/15" rel="nofollow">Conflicts between Mox, behaviours and optionnal arguments</a> <a class="badge-category__wrapper " href="/c/questions-help/questions/53" rel="nofollow"><span data-category-id="53" style="--category-badge-color: #C14BFB; --category-badge-text-color: #000000; --parent-category-badge-color: #C14BFB;" data-parent-category-id="171" data-drop-close="true" class="badge-category --style-square --has-parent" title="Elixir Questions / Help"><span class="badge-category__name">Questions</span></span></a>
    </div>
  </div>
  <blockquote>
    Yeah, the example isn’t ideal - we can move logic out to separate function and just pass data to it - I know. 
I just meant a scenario where you have logic that depends on other processes making HTTP/DB calls, but I didn’t want to introduce all that complexity into a simple forum example - that’s why I simplified it to just calc function <img width="20" height="20" src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title="smiley" alt="smiley" class="emoji">
  </blockquote>
</aside>

<p>I mean how to test a function that relies on data from process without spawning that process, and moving each time calculations/checking to do_function<br>
e.g<br>
again - that is just very simple example</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def foo() do
  case Boo.get_marekt_data() do
      ...
  end
end
</code></pre>
<p>vs</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def foo() do
  data = Boo.get_marekt_data()
  do_foo(data)
end

def do_foo(data) do
  case data do
    ...
  do
end
</code></pre>
<p>Do we really need to introduce behaviours in such cases and use Mox - instead of Mimic.<br>
Sorry but I don’t get it <img src="https://forum.elixirforum.com/images/emoji/apple/folded_hands.png?v=15" title=":folded_hands:" class="emoji" alt=":folded_hands:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376970" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-376970" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376970"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="376971" data-post-id="376971">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="funboy" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  funboy
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>I always find this argument so funny given a test implemention is literally an additional implementation.</p>
</blockquote>
<p>Adding a behaviour solely to enable mocking in tests has always felt a bit off to me.<br>
But maybe I’m missing sth - could u explain why adding behaviour solely for testing purposes is better than just stub/expect implementation in test via mimic?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376971" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-376971" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376971"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="376972" data-post-id="376972">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>To me the implementation details do not matter – you could use Mox, Mimic or whatever. They all eventually do the same - change the code that gets executed. Once you do that you by definition have at least two implemetations for the function call being made. Personally I see the need for this as a fact informing design. Often code can be restructured to not need any mocking – though the more external IO you do vs. actual internal logic. That’s what the video I linked earlier is all about. This also doesn’t mean you should never mock, but to me mocks are mostly needed for integeration level tests, where you indeed want to test the last bits of wiring between simpler to test pieces.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376972" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-376972" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376972"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="376975" data-post-id="376975">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="funboy" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  funboy
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="LostKobrakai" data-post="19" data-topic="73103">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lostkobrakai/48/3072_2.png" class="avatar"> LostKobrakai:</div>
<blockquote>
<p>To me the implementation details do not matter – you could use Mox, Mimic or whatever</p>
</blockquote>
</aside>
<p>I see <img src="https://forum.elixirforum.com/images/emoji/apple/ok_hand.png?v=15" title=":ok_hand:" class="emoji" alt=":ok_hand:" loading="lazy" width="20" height="20"></p>
<blockquote>
<p>Once you do that you by definition have at least two implemetations for the function call being made</p>
</blockquote>
<p>Yes, that was my goal - to introduce a boundary and test the logic in isolation from things like e.g. processes. Mox and explicit behaviours can achieve that, but in cases like this they feel like unnecessary boilerplate and add maintenance overhead for code that doesn’t really provide much value I guess <img src="https://forum.elixirforum.com/images/emoji/apple/thinking.png?v=15" title=":thinking:" class="emoji" alt=":thinking:" loading="lazy" width="20" height="20"></p>
<p>Thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376975" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-376975" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376975"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="377149" data-post-id="377149">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="funboy" data-post="11" data-topic="73103">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/f/ee7513/48.png" class="avatar"> funboy:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">test "for dataX should return respX" do
      dataX = ...
      expect(Boo, :data, fn -&gt; dataX end)
      assert respX == Boo.calc()
end
</code></pre>
</blockquote>
</aside>
<p>This is literally testing if Mimic works. You’re much better off directly assuming that Mimic does in fact work and then do something with <code>dataX</code> and assert on <em>that</em> return value.</p>
<p>For what it’s worth, IMO the other posters are giving you hard time for what seems to be practicing to be an architecture astronaut. We absolutely can’t put everything in a behaviour. Or we can but, you know, we have to ship today or tomorrow, not next month.</p>
<p>Your approach to using Mimic is quite fine (I have mostly migrated to it as well but I am mixing it with Mox because sometimes behaviours are required by other teammates, and sometimes even by me).</p>
<p>But your examples are not ideal – don’t go too micro.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="377149" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/conflicts-between-mox-behaviours-and-optionnal-arguments/73103/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-377149" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="377149"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>